From 7ac722081e4cdd850ad63ae67d1643ee546382d1 Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Mon, 18 Nov 2024 09:51:49 +0800 Subject: [PATCH 1/8] [bugfix] Improve App management page 1. reload apps when change domain 2. fix date format 3. fix order --- frontend/src/pages/AppManagement.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/AppManagement.vue b/frontend/src/pages/AppManagement.vue index 254efab..38ca627 100644 --- a/frontend/src/pages/AppManagement.vue +++ b/frontend/src/pages/AppManagement.vue @@ -39,11 +39,12 @@ + diff --git a/frontend/src/pages/FlowChart.vue b/frontend/src/pages/FlowChart.vue index 506107d..bdef9d1 100644 --- a/frontend/src/pages/FlowChart.vue +++ b/frontend/src/pages/FlowChart.vue @@ -3,11 +3,10 @@
-
- +
+
- -
+
@@ -78,7 +77,7 @@ import NodeItem from 'src/components/main/NodeItem.vue'; import ShowDialog from 'components/ShowDialog.vue'; import ActionSelect from 'components/ActionSelect.vue'; import PropertyPanel from 'components/right/PropertyPanel.vue'; -import AppSelector from 'components/left/AppSelector.vue'; +import AppDisplay from 'components/left/AppDisplay.vue'; import EventTree from 'components/left/EventTree.vue'; import { FlowCtrl } from '../control/flowctrl'; import { useQuasar } from 'quasar'; @@ -305,7 +304,7 @@ onMounted(() => { diff --git a/frontend/src/pages/FlowChart.vue b/frontend/src/pages/FlowChart.vue index 225740b..83f5f29 100644 --- a/frontend/src/pages/FlowChart.vue +++ b/frontend/src/pages/FlowChart.vue @@ -3,10 +3,7 @@
-
- -
-
+
@@ -41,8 +38,24 @@
+ + + + + +
{ return "300px"; } }); +const fixedLeftPosition = computed(()=>{ + return drawerLeft.value?"300px":"0px"; +}); const addNode = (node: IActionNode, inputPoint: string) => { if (drawerRight.value) { @@ -327,11 +342,6 @@ onMounted(() => { From ed27a18d25b124d1bee2b32dfbe2bc673856bd69 Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Mon, 18 Nov 2024 23:35:24 +0800 Subject: [PATCH 6/8] [UI] fix loading behavious in /flowChart --- frontend/src/pages/AppManagement.vue | 1 + frontend/src/pages/FlowChart.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/src/pages/AppManagement.vue b/frontend/src/pages/AppManagement.vue index 19b10d3..403cb4c 100644 --- a/frontend/src/pages/AppManagement.vue +++ b/frontend/src/pages/AppManagement.vue @@ -116,6 +116,7 @@ const editFlow = (app:IAppDisplay) => { appId: app.id, name: app.name }); + store.selectFlow(undefined); router.push('/FlowChart/' + app.id); }; diff --git a/frontend/src/pages/FlowChart.vue b/frontend/src/pages/FlowChart.vue index 83f5f29..2c0d150 100644 --- a/frontend/src/pages/FlowChart.vue +++ b/frontend/src/pages/FlowChart.vue @@ -77,6 +77,7 @@ From 4c8cc1def90207b41f0c496956491a4a791e9f7a Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Tue, 19 Nov 2024 11:25:55 +0800 Subject: [PATCH 7/8] [bugfix] id format error when saving flow --- frontend/src/pages/AppManagement.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/AppManagement.vue b/frontend/src/pages/AppManagement.vue index 403cb4c..3ee1737 100644 --- a/frontend/src/pages/AppManagement.vue +++ b/frontend/src/pages/AppManagement.vue @@ -57,9 +57,10 @@ interface IAppDisplay{ } const authStore = useAuthStore(); +const numberStringSorting = (a: string, b: string) => parseInt(a, 10) - parseInt(b, 10); const columns = [ - { name: 'id', label: 'アプリID', field: 'id', align: 'left', sortable: true }, + { name: 'id', label: 'アプリID', field: 'id', align: 'left', sortable: true, sort: numberStringSorting }, { name: 'name', label: 'アプリ名', field: 'name', align: 'left', sortable: true }, { name: 'url', label: 'URL', field: 'url', align: 'left', sortable: true }, { name: 'user', label: '最後更新者', field: 'user', align: 'left', sortable: true}, @@ -77,16 +78,16 @@ const store = useFlowEditorStore(); const getApps = async () => { loading.value = true; const result = await api.get('api/apps'); - rows.value = result.data.map((item:IManagedApp) => { + rows.value = result.data.map((item: IManagedApp) => { return { - id: Number(item.appid), + id: item.appid, name: item.appname, url: `${item.domainurl}/k/${item.appid}`, user: `${item.user.first_name} ${item.user.last_name}` , updatetime:date.formatDate(item.update_time, 'YYYY/MM/DD HH:mm'), version: Number(item.version) } - }).sort((a, b) => a.id - b.id); // set default order + }).sort((a: IAppDisplay, b: IAppDisplay) => numberStringSorting(a.id, b.id)); // set default order loading.value = false; } From 4563274789854c5f871b4f9ec135b5e7f3ab22e0 Mon Sep 17 00:00:00 2001 From: "xiaozhe.ma" Date: Wed, 20 Nov 2024 15:09:45 +0900 Subject: [PATCH 8/8] backend bug fix --- backend/app/api/api_v1/routers/kintone.py | 128 ++++++++++----------- backend/app/api/api_v1/routers/platform.py | 5 +- backend/app/db/crud.py | 12 +- 3 files changed, 75 insertions(+), 70 deletions(-) diff --git a/backend/app/api/api_v1/routers/kintone.py b/backend/app/api/api_v1/routers/kintone.py index 41dd61b..b1c826a 100644 --- a/backend/app/api/api_v1/routers/kintone.py +++ b/backend/app/api/api_v1/routers/kintone.py @@ -156,10 +156,10 @@ def getsettingfromexcel(df): des = df.iloc[2,2] return {"name":appname,"description":des} -def getsettingfromkintone(app:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} +def getsettingfromkintone(app:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} params = {"app":app} - url = f"{c.BASE_URL}{config.API_V1_STR}/app/settings.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/app/settings.json" r = httpx.get(url,headers=headers,params=params) return r.json() @@ -171,24 +171,24 @@ def analysesettings(excel,kintone): updatesettings[key] = excel[key] return updatesettings -def createkintoneapp(name:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} +def createkintoneapp(name:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} data = {"name":name} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app.json" r = httpx.post(url,headers=headers,data=json.dumps(data)) return r.json() -def updateappsettingstokintone(app:str,updates:dict,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/settings.json" +def updateappsettingstokintone(app:str,updates:dict,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/settings.json" data = {"app":app} data.update(updates) r = httpx.put(url,headers=headers,data=json.dumps(data)) return r.json() -def addfieldstokintone(app:str,fields:dict,c:config.KINTONE_ENV,revision:str = None): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" +def addfieldstokintone(app:str,fields:dict,env:config.KINTONE_ENV,revision:str = None): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" if revision != None: data = {"app":app,"revision":revision,"properties":fields} else: @@ -197,43 +197,43 @@ def addfieldstokintone(app:str,fields:dict,c:config.KINTONE_ENV,revision:str = N r.raise_for_status() return r.json() -def updatefieldstokintone(app:str,revision:str,fields:dict,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" +def updatefieldstokintone(app:str,revision:str,fields:dict,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" data = {"app":app,"properties":fields} r = httpx.put(url,headers=headers,data=json.dumps(data)) return r.json() -def deletefieldsfromkintone(app:str,revision:str,fields:dict,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" +def deletefieldsfromkintone(app:str,revision:str,fields:dict,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/form/fields.json" params = {"app":app,"revision":revision,"fields":fields} #r = httpx.delete(url,headers=headers,content=json.dumps(params)) r = httpx.request(method="DELETE",url=url,headers=headers,content=json.dumps(params)) return r.json() -def deoployappfromkintone(app:str,revision:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json" +def deoployappfromkintone(app:str,revision:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json" data = {"apps":[{"app":app,"revision":revision}],"revert": False} r = httpx.post(url,headers=headers,data=json.dumps(data)) return r.json # 既定項目に含めるアプリのフィールドのみ取得する # スペース、枠線、ラベルを含まない -def getfieldsfromkintone(app:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} +def getfieldsfromkintone(app:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} params = {"app":app} - url = f"{c.BASE_URL}{config.API_V1_STR}/app/form/fields.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/app/form/fields.json" r = httpx.get(url,headers=headers,params=params) return r.json() # フォームに配置するフィールドのみ取得する # スペース、枠線、ラベルも含める -def getformfromkintone(app:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} +def getformfromkintone(app:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} params = {"app":app} - url = f"{c.BASE_URL}{config.API_V1_STR}/form.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/form.json" r = httpx.get(url,headers=headers,params=params) return r.json() @@ -286,10 +286,10 @@ def analysefields(excel,kintone): return {"update":updatefields,"add":addfields,"del":delfields} -def getprocessfromkintone(app:str,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} +def getprocessfromkintone(app:str,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} params = {"app":app} - url = f"{c.BASE_URL}{config.API_V1_STR}/app/status.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/app/status.json" r = httpx.get(url,headers=headers,params=params) return r.json() @@ -374,24 +374,24 @@ def getkintoneorgs(c:config.KINTONE_ENV): r = httpx.get(url,headers=headers,params=params) return r.json() -def uploadkintonefiles(file,c:config.KINTONE_ENV): +def uploadkintonefiles(file,env:config.KINTONE_ENV): if (file.endswith('alc_runtime.js') and config.DEPLOY_MODE == "DEV"): return {'fileKey':file} upload_files = {'file': open(file,'rb')} - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} data ={'name':'file','filename':os.path.basename(file)} - url = f"{c.BASE_URL}/k/v1/file.json" + url = f"{env.BASE_URL}/k/v1/file.json" r = httpx.post(url,headers=headers,data=data,files=upload_files) #{"name":data['filename'],'fileKey':r['fileKey']} return r.json() -def updateappjscss(app,uploads,c:config.KINTONE_ENV): +def updateappjscss(app,uploads,env:config.KINTONE_ENV): dsjs = [] dscss = [] #mobile側 mbjs = [] mbcss = [] - customize = getappcustomize(app, c) + customize = getappcustomize(app, env) current_js = customize['desktop'].get('js', []) current_css = customize['desktop'].get('css', []) current_mobile_js = customize['mobile'].get('js', []) @@ -430,16 +430,16 @@ def updateappjscss(app,uploads,c:config.KINTONE_ENV): ds ={'js':dsjs,'css':dscss} mb ={'js':mbjs,'css':mbcss} data = {'app':app,'scope':'ALL','desktop':ds,'mobile':mb,'revision':customize["revision"]} - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/customize.json" + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/customize.json" print(json.dumps(data)) r = httpx.put(url,headers=headers,data=json.dumps(data)) return r.json() #kintone カスタマイズ情報 -def getappcustomize(app,c:config.KINTONE_ENV): - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/customize.json" +def getappcustomize(app,env:config.KINTONE_ENV): + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/customize.json" params = {"app":app} r = httpx.get(url,headers=headers,params=params) return r.json() @@ -451,9 +451,9 @@ def getTempPath(filename): fpath = os.path.join(rootdir,"Temp",filename) return fpath -def createappjs(domainid,app): +def createappjs(domain_url,app): db = SessionLocal() - flows = get_flows_by_app(db,domainid,app) + flows = get_flows_by_app(db,domain_url,app) db.close() content={} for flow in flows: @@ -521,7 +521,7 @@ async def upload(request:Request,files:t.List[UploadFile] = File(...)): return {"files": [file.filename for file in files]} @r.post("/updatejscss") -async def jscss(request:Request,app:str,files:t.List[UploadFile] = File(...),env = Depends(getkintoneenv)): +async def jscss(request:Request,app:str,files:t.List[UploadFile] = File(...),env:config.KINTONE_ENV = Depends(getkintoneenv)): try: jscs=[] for file in files: @@ -542,21 +542,21 @@ async def jscss(request:Request,app:str,files:t.List[UploadFile] = File(...),env raise APIException('kintone:updatejscss',request.url._url, f"Error occurred while update js/css {file.filename} is not an Excel file",e) @r.get("/app") -async def app(request:Request,app:str,c:config.KINTONE_ENV=Depends(getkintoneenv)): +async def app(request:Request,app:str,env:config.KINTONE_ENV=Depends(getkintoneenv)): try: - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} - url = f"{c.BASE_URL}{config.API_V1_STR}/app.json" + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} + url = f"{env.BASE_URL}{config.API_V1_STR}/app.json" params ={"id":app} r = httpx.get(url,headers=headers,params=params) return r.json() except Exception as e: - raise APIException('kintone:app',request.url._url, f"Error occurred while get app({c.DOMAIN_NAME}->{app}):",e) + raise APIException('kintone:app',request.url._url, f"Error occurred while get app({env.DOMAIN_NAME}->{app}):",e) @r.get("/allapps") -async def allapps(request:Request,c:config.KINTONE_ENV=Depends(getkintoneenv)): +async def allapps(request:Request,env:config.KINTONE_ENV=Depends(getkintoneenv)): try: - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} - url = f"{c.BASE_URL}{config.API_V1_STR}/apps.json" + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} + url = f"{env.BASE_URL}{config.API_V1_STR}/apps.json" offset = 0 limit = 100 all_apps = [] @@ -572,17 +572,17 @@ async def allapps(request:Request,c:config.KINTONE_ENV=Depends(getkintoneenv)): return {"apps": all_apps} except Exception as e: - raise APIException('kintone:allapps', request.url._url, f"Error occurred while get allapps({c.DOMAIN_NAME}):", e) + raise APIException('kintone:allapps', request.url._url, f"Error occurred while get allapps({env.DOMAIN_NAME}):", e) @r.get("/appfields") -async def appfields(request:Request,app:str,env = Depends(getkintoneenv)): +async def appfields(request:Request,app:str,env:config.KINTONE_ENV = Depends(getkintoneenv)): try: return getfieldsfromkintone(app,env) except Exception as e: raise APIException('kintone:appfields',request.url._url, f"Error occurred while get app fileds({env.DOMAIN_NAME}->{app}):",e) @r.get("/allfields") -async def allfields(request:Request,app:str,env = Depends(getkintoneenv)): +async def allfields(request:Request,app:str,env:config.KINTONE_ENV = Depends(getkintoneenv)): try: field_resp = getfieldsfromkintone(app,env) form_resp = getformfromkintone(app,env) @@ -591,38 +591,38 @@ async def allfields(request:Request,app:str,env = Depends(getkintoneenv)): raise APIException('kintone:allfields',request.url._url, f"Error occurred while get form fileds({env.DOMAIN_NAME}->{app}):",e) @r.get("/appprocess") -async def appprocess(request:Request,app:str,env = Depends(getkintoneenv)): +async def appprocess(request:Request,app:str,env:config.KINTONE_ENV = Depends(getkintoneenv)): try: return getprocessfromkintone(app,env) except Exception as e: raise APIException('kintone:appprocess',request.url._url, f"Error occurred while get app process({env.DOMAIN_NAME}->{app}):",e) @r.get("/alljscss") -async def alljscs(request:Request,app:str,c:config.KINTONE_ENV=Depends(getkintoneenv)): +async def alljscs(request:Request,app:str,env:config.KINTONE_ENV=Depends(getkintoneenv)): try: - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} - url = f"{c.BASE_URL}{config.API_V1_STR}/app/customize.json" + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE} + url = f"{env.BASE_URL}{config.API_V1_STR}/app/customize.json" params = {"app":app} r = httpx.get(url,headers=headers,params=params) return r.json() except Exception as e: - raise APIException('kintone:alljscss',request.url._url, f"Error occurred while get app js/css({c.DOMAIN_NAME}->{app}):",e) + raise APIException('kintone:alljscss',request.url._url, f"Error occurred while get app js/css({env.DOMAIN_NAME}->{app}):",e) @r.post("/createapp",) -async def createapp(request:Request,name:str,c:config.KINTONE_ENV=Depends(getkintoneenv)): +async def createapp(request:Request,name:str,env:config.KINTONE_ENV=Depends(getkintoneenv)): try: - headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} + headers={config.API_V1_AUTH_KEY:env.API_V1_AUTH_VALUE,"Content-Type": "application/json"} data = {"name":name} - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app.json" r = httpx.post(url,headers=headers,data=json.dumps(data)) result = r.json() if result.get("app") != None: - url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json" + url = f"{env.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json" data = {"apps":[result],"revert": False} r = httpx.post(url,headers=headers,data=json.dumps(data)) return r.json except Exception as e: - raise APIException('kintone:createapp',request.url._url, f"Error occurred while create app({c.DOMAIN_NAME}->{name}):",e) + raise APIException('kintone:createapp',request.url._url, f"Error occurred while create app({env.DOMAIN_NAME}->{name}):",e) @r.post("/createappfromexcel",) @@ -761,7 +761,7 @@ async def createjstokintone(request:Request,app:str,env:config.KINTONE_ENV = Dep try: jscs=[] files=[] - files.append(createappjs(env.DOMAIN_ID, app)) + files.append(createappjs(env.BASE_URL, app)) files.append(getTempPath('alc_runtime.js')) files.append(getTempPath('alc_runtime.css')) for file in files: diff --git a/backend/app/api/api_v1/routers/platform.py b/backend/app/api/api_v1/routers/platform.py index 5857c02..b616def 100644 --- a/backend/app/api/api_v1/routers/platform.py +++ b/backend/app/api/api_v1/routers/platform.py @@ -214,11 +214,14 @@ async def flow_create( ) async def flow_edit( request: Request, + flowid: str, flow: FlowBase, + user=Depends(get_current_user), db=Depends(get_db), ): try: - return edit_flow(db, flow) + domain = get_activedomain(db, user.id) + return edit_flow(db,domain.url, flow) except Exception as e: raise APIException('platform:flow',request.url._url,f"Error occurred while edit flow:",e) diff --git a/backend/app/db/crud.py b/backend/app/db/crud.py index ebd19fb..45b5bff 100644 --- a/backend/app/db/crud.py +++ b/backend/app/db/crud.py @@ -190,15 +190,17 @@ def delete_flow(db: Session, flowid: str): def edit_flow( - db: Session, flow: schemas.FlowBase + db: Session, domainurl: str, flow: schemas.FlowBase ) -> schemas.Flow: db_flow = get_flow(db, flow.flowid) if not db_flow: - raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Flow not found") + #見つからない時新規作成 + return create_flow(db,domainurl,flow) + update_data = flow.dict(exclude_unset=True) for key, value in update_data.items(): - setattr(db_flow, key, value) + setattr(db_flow, key, value) db.add(db_flow) db.commit() @@ -214,8 +216,8 @@ def get_flows(db: Session, flowid: str): def get_flow(db: Session, flowid: str): flow = db.query(models.Flow).filter(models.Flow.flowid == flowid).first() - if not flow: - raise HTTPException(status_code=404, detail="Data not found") + # if not flow: + # raise HTTPException(status_code=404, detail="Data not found") return flow def get_flows_by_app(db: Session,domainurl: str, appid: str):