fix: return plain dict (ahserver handles serialization), match CRUD pattern exactly
This commit is contained in:
parent
4a0b9db82a
commit
fa81da2bbf
@ -10,7 +10,7 @@ ns['id'] = id
|
|||||||
|
|
||||||
userorgid = await get_userorgid()
|
userorgid = await get_userorgid()
|
||||||
if not userorgid:
|
if not userorgid:
|
||||||
return json.dumps({'widgettype':'Error','options':{'title':'Authorization Error','message':'Please login'}}, ensure_ascii=False)
|
return {'widgettype':'Error','options':{'title':'Authorization Error','message':'Please login'}}
|
||||||
ns['resellerid'] = userorgid
|
ns['resellerid'] = userorgid
|
||||||
ns['created_by'] = userorgid
|
ns['created_by'] = userorgid
|
||||||
ns['created_at'] = timestampstr()
|
ns['created_at'] = timestampstr()
|
||||||
@ -34,6 +34,6 @@ db = DBPools()
|
|||||||
dbname = get_module_dbname('supplychain')
|
dbname = get_module_dbname('supplychain')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
await sor.C('supply_contracts', ns.copy())
|
await sor.C('supply_contracts', ns.copy())
|
||||||
return json.dumps({'widgettype':'Message','options':{'title':'Add Success','message':'供应合同创建成功'}}, ensure_ascii=False)
|
return {'widgettype':'Message','options':{'title':'Add Success','message':'供应合同创建成功'}}
|
||||||
|
|
||||||
return json.dumps({'widgettype':'Error','options':{'title':'Add Error','message':'failed'}}, ensure_ascii=False)
|
return {'widgettype':'Error','options':{'title':'Add Error','message':'failed'}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user