rbac/wwwroot/add_provider.dspy
2026-01-07 15:08:54 +08:00

38 lines
709 B
Plaintext

ns = params_kw.copy()
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
ns['id'] = id
db = DBPools()
dbname = get_module_dbname('rbac')
async with db.sqlorContext(dbname) as sor:
ownerid = await get_userorgid()
orgid = id
await create_org(sor, ns, orgtypes=['provider'])
try:
await openRetailRelationshipAccounts(sor, ownerid, ownerid, orgid)
except Exception as e:
exception(f'{e}')
return {
"widgettype":"Message",
"options":{
"user_data":ns,
"cwidth":16,
"cheight":9,
"title":"Add Success",
"timeout":3,
"message":"ok"
}
}
return {
"widgettype":"Error",
"options":{
"title":"Add Error",
"cwidth":16,
"cheight":9,
"timeout":3,
"message":"failed"
}
}