bugfix kintone createappjs

This commit is contained in:
2025-01-24 16:57:24 +09:00
parent 9c9b5aca95
commit 3eedbf7564
2 changed files with 7 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ from app.core.dbmanager import get_db
from app.db.crud import get_flows_by_app,get_kintoneformat
from app.core.auth import get_current_active_user,get_current_user
from app.core.apiexception import APIException
from app.db.cruddb import domainService
from app.db.cruddb import domainService,appService
kinton_router = r = APIRouter()
@@ -452,10 +452,10 @@ def getTempPath(filename):
fpath = os.path.join(rootdir,"Temp",filename)
return fpath
def createappjs(domain_url,app):
db = SessionLocal()
flows = get_flows_by_app(db,domain_url,app)
db.close()
def createappjs(domain_url,app,db = Depends(get_db)):
#db = SessionLocal()
flows = appService.get_flow(domain_url,app) #get_flows_by_app(db,domain_url,app)
#db.close()
content={}
for flow in flows:
content[flow.eventid] = {'flowid':flow.flowid,'name':flow.name,'content':flow.content}

View File

@@ -251,7 +251,7 @@ async def flow_details(
domainurl = domainCacheService.get_default_domainurl(db,user.id)
if not domainurl:
return ApiReturnModel(data = None)
return ApiReturnModel(data = appService.get_flow(db, domainurl, appid,user.id))
return ApiReturnModel(data = appService.get_flow(db, domainurl, appid))
except Exception as e:
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by flowid:",e)
@@ -271,7 +271,7 @@ async def flow_list(
if not domainurl:
return []
#flows = get_flows_by_app(db, domainurl, appid)
flows = appService.get_flow(db,domainurl,appid,user.id)
flows = appService.get_flow(db,domainurl,appid)
return flows
except Exception as e:
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by appid:",e)