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},