From 9af58ee8a39952825f8e1459da25a76004f157bb Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 10 Jan 2023 17:39:53 +0100 Subject: [PATCH] feat(chalice): fixed cards api after DB changes --- api/chalicelib/core/custom_metrics.py | 2 +- ee/api/chalicelib/core/custom_metrics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index 3c6e6fd68..b3df735a7 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -379,7 +379,7 @@ def search_all(project_id, user_id, data: schemas.SearchCardsSchema, include_ser query = cur.mogrify( f"""SELECT metric_id, project_id, user_id, name, is_public, created_at, edited_at, metric_type, metric_of, metric_format, metric_value, view_type, is_pinned, - predefined_key, dashboards, owner_email, default_config AS config, thumbnail + dashboards, owner_email, default_config AS config, thumbnail FROM metrics {sub_join} LEFT JOIN LATERAL (SELECT COALESCE(jsonb_agg(connected_dashboards.* ORDER BY is_public,name),'[]'::jsonb) AS dashboards diff --git a/ee/api/chalicelib/core/custom_metrics.py b/ee/api/chalicelib/core/custom_metrics.py index 406bf3c6a..3f9d3aaf7 100644 --- a/ee/api/chalicelib/core/custom_metrics.py +++ b/ee/api/chalicelib/core/custom_metrics.py @@ -409,7 +409,7 @@ def search_all(project_id, user_id, data: schemas.SearchCardsSchema, include_ser query = cur.mogrify( f"""SELECT metric_id, project_id, user_id, name, is_public, created_at, edited_at, metric_type, metric_of, metric_format, metric_value, view_type, is_pinned, - predefined_key, dashboards, owner_email, default_config AS config, thumbnail + dashboards, owner_email, default_config AS config, thumbnail FROM metrics {sub_join} LEFT JOIN LATERAL (SELECT COALESCE(jsonb_agg(connected_dashboards.* ORDER BY is_public,name),'[]'::jsonb) AS dashboards