diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 486b2ad..0103a19 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -43,7 +43,7 @@ async def edit( #只能报表所有者编辑 # res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id}, # {'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}}) - + # if not res.matched_count: # #if res.matched_count: # return schemas.Msg(code=-1, msg='只能报表所有者编辑') @@ -90,8 +90,12 @@ async def read_report( dashboard = await crud.dashboard.get(db, id=data_in.dashboard_id) # projection = {'query': False} projection = None + #获取已建报表 属于自己的 + # reports = await crud.report.read_report(db, project_id=data_in.project_id, + # projection=projection, **ext_where) + #有权限的都能获取到 reports = await crud.report.read_report(db, project_id=data_in.project_id, - projection=projection, **ext_where) + projection=projection) for item in reports: item['added'] = False