Skip to content

Commit af9082e

Browse files
🐛 bugfix on wallet update (#4589)
1 parent 0f9d22d commit af9082e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

services/web/server/src/simcore_service_webserver/wallets/_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ async def update_wallet(
7070
user_id: UserID,
7171
wallet_id: WalletID,
7272
name: str,
73-
description: str,
74-
thumbnail: str,
73+
description: str | None,
74+
thumbnail: str | None,
7575
status: WalletStatus,
7676
) -> WalletGet:
7777
wallet: UserWalletDB = await db.get_wallet_for_user(

services/web/server/src/simcore_service_webserver/wallets/_db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ async def update_wallet(
180180
app: web.Application,
181181
wallet_id: WalletID,
182182
name: str,
183-
description: str,
184-
thumbnail: str,
183+
description: str | None,
184+
thumbnail: str | None,
185185
status: WalletStatus,
186186
) -> WalletDB:
187187
async with get_database_engine(app).acquire() as conn:

services/web/server/src/simcore_service_webserver/wallets/_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ async def list_wallets(request: web.Request):
111111

112112
class _PutWalletBodyParams(BaseModel):
113113
name: str
114-
description: str
115-
thumbnail: str
114+
description: str | None
115+
thumbnail: str | None
116116
status: WalletStatus
117117

118118
class Config:

services/web/server/tests/unit/with_dbs/03/wallets/test_wallets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ async def test_wallets_full_workflow(
6868
f"{url}",
6969
json={
7070
"name": "My first wallet",
71-
"description": "New description",
71+
"description": None,
7272
"thumbnail": "New thumbnail",
7373
"status": "INACTIVE",
7474
},
7575
)
7676
data, _ = await assert_status(resp, web.HTTPOk)
7777
assert data["wallet_id"] == added_wallet["wallet_id"]
7878
assert data["name"] == "My first wallet"
79-
assert data["description"] == "New description"
79+
assert data["description"] == None
8080
assert data["thumbnail"] == "New thumbnail"
8181
assert data["status"] == "INACTIVE"
8282
assert arrow.get(data["modified"]) > store_modified_field
@@ -88,7 +88,7 @@ async def test_wallets_full_workflow(
8888
assert len(data) == 1
8989
assert data[0]["wallet_id"] == added_wallet["wallet_id"]
9090
assert data[0]["name"] == "My first wallet"
91-
assert data[0]["description"] == "New description"
91+
assert data[0]["description"] == None
9292
assert data[0]["thumbnail"] == "New thumbnail"
9393
assert data[0]["status"] == "INACTIVE"
9494
assert arrow.get(data[0]["modified"]) > store_modified_field

0 commit comments

Comments
 (0)