mirror of
https://github.com/devproje/balance-application.git
synced 2024-10-20 15:11:21 +00:00
feat: middle save
This commit is contained in:
parent
d279776baa
commit
4eb5ad04f1
2 changed files with 2 additions and 2 deletions
|
@ -87,7 +87,7 @@ def find(id, req: Request, resp: Response):
|
||||||
"respond_time": "{}ms".format(round((datetime.now().microsecond / 1000) - started))
|
"respond_time": "{}ms".format(round((datetime.now().microsecond / 1000) - started))
|
||||||
}
|
}
|
||||||
|
|
||||||
@router.patch("/balance/{id}")
|
@router.put("/balance/{id}")
|
||||||
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()
|
||||||
|
|
|
@ -86,7 +86,7 @@ class BalanceService:
|
||||||
ok = True
|
ok = True
|
||||||
cur = self._conn.cursor()
|
cur = self._conn.cursor()
|
||||||
try:
|
try:
|
||||||
cur.execute(f"update balset set name = %s, date = %s, price = %s, buy = %s, memo = %s where id = %s;", (
|
cur.execute("update balset set name = %s, date = %s, price = %s, buy = %s, memo = %s where id = %s;", (
|
||||||
balance.name,
|
balance.name,
|
||||||
balance.date,
|
balance.date,
|
||||||
balance.price,
|
balance.price,
|
||||||
|
|
Loading…
Reference in a new issue