bugfix get/apps
This commit is contained in:
@@ -32,7 +32,7 @@ async def test(
|
|||||||
|
|
||||||
@r.get(
|
@r.get(
|
||||||
"/apps",tags=["App"],
|
"/apps",tags=["App"],
|
||||||
response_model=ApiReturnPage[AppList],
|
response_model=ApiReturnModel[List[AppList]|None],
|
||||||
response_model_exclude_none=True,
|
response_model_exclude_none=True,
|
||||||
)
|
)
|
||||||
async def apps_list(
|
async def apps_list(
|
||||||
@@ -41,11 +41,11 @@ async def apps_list(
|
|||||||
db=Depends(get_db),
|
db=Depends(get_db),
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
filtered_apps = []
|
|
||||||
domain = dbdomain.get_default_domain(db,user.id) #get_activedomain(db, user.id)
|
domain = dbdomain.get_default_domain(db,user.id) #get_activedomain(db, user.id)
|
||||||
if not domain:
|
if not domain:
|
||||||
return ApiReturnPage(data = filtered_apps)
|
return ApiReturnModel(data = None)
|
||||||
|
filtered_apps = []
|
||||||
platformapps = get_apps(db,domain.url)
|
platformapps = get_apps(db,domain.url)
|
||||||
kintoneevn = config.KINTONE_ENV(domain)
|
kintoneevn = config.KINTONE_ENV(domain)
|
||||||
headers={config.API_V1_AUTH_KEY:kintoneevn.API_V1_AUTH_VALUE}
|
headers={config.API_V1_AUTH_KEY:kintoneevn.API_V1_AUTH_VALUE}
|
||||||
@@ -68,7 +68,7 @@ async def apps_list(
|
|||||||
if papp.appid in kintone_apps_dict:
|
if papp.appid in kintone_apps_dict:
|
||||||
papp.appname = kintone_apps_dict[papp.appid]["name"]
|
papp.appname = kintone_apps_dict[papp.appid]["name"]
|
||||||
filtered_apps.append(papp)
|
filtered_apps.append(papp)
|
||||||
return ApiReturnPage(data = filtered_apps)
|
return ApiReturnModel(data = filtered_apps)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise APIException('platform:apps',request.url._url,f"Error occurred while get apps:",e)
|
raise APIException('platform:apps',request.url._url,f"Error occurred while get apps:",e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user