From a2d08b35e90bf32a48b40bc3062bfe225f16dad2 Mon Sep 17 00:00:00 2001 From: wuaho Date: Mon, 26 Jul 2021 20:34:42 +0800 Subject: [PATCH] update --- api/api_v1/endpoints/report.py | 4 +++- schemas/dashboard.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 84191db..bf7a912 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -66,9 +66,11 @@ async def read_report( for item in reports: item['added'] = False - added_ids = [item['report_id'] for item in dashboard.get('reports', [])] + item['show_config'] = dict() + added_ids = {item['report_id']: item for item in dashboard.get('reports', [])} if item['_id'] in added_ids: item['added'] = True + item['show_config'] = added_ids[item['_id']] return schemas.Msg(code=0, msg='ok', data=reports) diff --git a/schemas/dashboard.py b/schemas/dashboard.py index 93ab20f..714cd96 100644 --- a/schemas/dashboard.py +++ b/schemas/dashboard.py @@ -44,6 +44,7 @@ class Report(BaseModel): report_id: str graph_type: str model: str + graph_size: str class AddReport(DBBase):