bugfix get flow -> get flow by appid

This commit is contained in:
2024-12-09 16:54:51 +09:00
parent b874d0c776
commit a3df6c4b37
2 changed files with 12 additions and 7 deletions

View File

@@ -236,22 +236,24 @@ async def action_data(
raise APIException('platform:actions',request.url._url,f"Error occurred while get actions:",e)
@r.get(
"/flow/{flowid}",
response_model=Flow,
"/flow/{appid}",tags=["App"],
response_model=ApiReturnModel[List[Flow|None]],
response_model_exclude_none=True,
)
async def flow_details(
request: Request,
flowid: str,
appid: str,
user=Depends(get_current_active_user),
db=Depends(get_db),
):
try:
app = get_flow(db, flowid)
return app
domain = domainService.get_default_domain(db, user.id)
if not domain:
return ApiReturnModel(data = None)
return ApiReturnModel(data = appService.get_flow(db, domain.url, appid,user.id))
except Exception as e:
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by flowid:",e)
@r.get(
"/flows/{appid}",
response_model=List[Flow|None],