feat(chalice): fixed get card

This commit is contained in:
Taha Yassine Kraiem 2023-01-24 16:54:09 +01:00
parent 302119c3f5
commit 0c7aee1f95

View file

@ -484,7 +484,7 @@ def get_card(metric_id, project_id, user_id, flatten=True, include_data: bool =
f"""SELECT metric_id, project_id, user_id, name, is_public, created_at, deleted_at, edited_at, metric_type,
view_type, metric_of, metric_value, metric_format, is_pinned, predefined_key, default_config,
thumbnail, default_config AS config,
series, dashboards, owner_email, {',data' if include_data else ''}
series, dashboards, owner_email {',data' if include_data else ''}
FROM metrics
LEFT JOIN LATERAL (SELECT COALESCE(jsonb_agg(metric_series.* ORDER BY index),'[]'::jsonb) AS series
FROM metric_series