fix: server payload not applied fixed

This commit is contained in:
Project_IO 2024-09-15 17:22:57 +09:00
parent 4eb5ad04f1
commit 6ae4b78a98

View file

@ -91,8 +91,6 @@ def find(id, req: Request, resp: Response):
def update(id, balance: UpdateForm, req: Request, resp: Response): def update(id, balance: UpdateForm, req: Request, resp: Response):
started = datetime.now().microsecond / 1000 started = datetime.now().microsecond / 1000
auth = AuthService() auth = AuthService()
print(auth.check_auth(req))
if not auth.check_auth(req): if not auth.check_auth(req):
resp.status_code = 403 resp.status_code = 403
return { return {
@ -101,11 +99,7 @@ def update(id, balance: UpdateForm, req: Request, resp: Response):
} }
service = BalanceService() service = BalanceService()
ok = service.update(int(id), balance)
ok = service.update(
int(id),
UpdateForm(balance.name, balance.date, balance.price, balance.buy, balance.memo)
)
if not ok == 1: if not ok == 1:
resp.status_code = 500 resp.status_code = 500