From 80af4c5a7ec14a6eeb1fad0087117ec051cd88e3 Mon Sep 17 00:00:00 2001 From: wuaho Date: Wed, 28 Jul 2021 15:28:25 +0800 Subject: [PATCH] 1 --- api/api_v1/endpoints/dashboard.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/api_v1/endpoints/dashboard.py b/api/api_v1/endpoints/dashboard.py index 085c2b3..08e49b0 100644 --- a/api/api_v1/endpoints/dashboard.py +++ b/api/api_v1/endpoints/dashboard.py @@ -82,6 +82,12 @@ async def copy( item['pid'] = dest_space_id item['cat'] = 'space' item['_id'] = get_uid() + for report in item['reports']: + report_id = report['report_id'] + new_report = crud.report.get(db, report_id) + new_report['_id'] = get_uid() + await crud.report.insert_one(db, new_report) + await crud.dashboard.update_one(db, {'project_id': item['project_id'], 'name': item['name'], 'user_id': item['user_id']}, {'$set': item},