diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 69e9916..6df6124 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -44,6 +44,7 @@ async def edit( return schemas.Msg(code=0, msg='ok', data='编辑成功') + @router.post("/copy") async def copy( request: Request, @@ -64,6 +65,7 @@ async def copy( await crud.report.insert_one(db, new_report) return schemas.Msg(code=0, msg='ok', data='编辑成功') + @router.post("/read_report") async def read_report( request: Request, @@ -91,6 +93,7 @@ async def read_report( if item['_id'] in added_ids: item['added'] = True item['show_config'] = added_ids[item['_id']] + reports = sorted(reports, key=lambda x: x.get('sorted', 999)) return schemas.Msg(code=0, msg='ok', data=reports)