mani.py on_event->lifespan; error->return code -1

This commit is contained in:
2024-12-03 16:53:18 +09:00
parent 25ee2f8747
commit 0c384bf57b
4 changed files with 22 additions and 10 deletions

View File

@@ -31,8 +31,8 @@ async def test(
@r.get(
"/apps",
response_model=List[AppList],
"/apps",tags=["App"],
response_model=ApiReturnPage[AppList],
response_model_exclude_none=True,
)
async def apps_list(
@@ -44,7 +44,7 @@ async def apps_list(
filtered_apps = []
domain = dbdomain.get_default_domain(db,user.id) #get_activedomain(db, user.id)
if not domain:
return filtered_apps
return ApiReturnPage(data = filtered_apps)
platformapps = get_apps(db,domain.url)
kintoneevn = config.KINTONE_ENV(domain)
@@ -68,10 +68,11 @@ async def apps_list(
if papp.appid in kintone_apps_dict:
papp.appname = kintone_apps_dict[papp.appid]["name"]
filtered_apps.append(papp)
return filtered_apps
return ApiReturnPage(data = filtered_apps)
except Exception as e:
raise APIException('platform:apps',request.url._url,f"Error occurred while get apps:",e)
@r.post("/apps", response_model=AppList, response_model_exclude_none=True)
async def apps_update(
request: Request,