fix: supplychain_accounting update/delete return widgettype format

This commit is contained in:
yumoqing 2026-07-03 15:08:21 +08:00
parent 63a1bedeba
commit 32070a53b1
2 changed files with 4 additions and 4 deletions

View File

@ -7,9 +7,9 @@ if isinstance(data, str):
record_id = data.get("id")
if not record_id:
return {"status": "error", "message": "Missing record id"}
return {"widgettype":"Error","options":{"title":"Delete Error","message":"Missing record id","cwidth":16,"cheight":9,"timeout":3}}
db = DBPools()
async with db.sqlorContext(dbname) as sor:
await sor.D("supplychain_accounting", {"id": record_id})
return {"status": "ok", "message": "Deleted successfully"}
return {"widgettype":"Message","options":{"title":"Delete Success","message":"ok","cwidth":16,"cheight":9,"timeout":3}}

View File

@ -8,7 +8,7 @@ if isinstance(data, str):
record_id = data.get("id")
if not record_id:
return {"status": "error", "message": "Missing record id"}
return {"widgettype":"Error","options":{"title":"Update Error","message":"Missing record id","cwidth":16,"cheight":9,"timeout":3}}
data["updated_at"] = timestampstr()
@ -18,4 +18,4 @@ for key in ["id", "resellerid", "created_by", "created_at"]:
db = DBPools()
async with db.sqlorContext(dbname) as sor:
await sor.U("supplychain_accounting", data)
return {"status": "ok", "data": data}
return {"widgettype":"Message","options":{"title":"Update Success","message":"ok","cwidth":16,"cheight":9,"timeout":3}}