From eb065deb3ddb4e90d36bfdf923be2013119c7fa8 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 17 Jan 2022 16:20:33 +0100 Subject: [PATCH] feat(api): custom metrics return full-metric on create and update --- api/chalicelib/core/custom_metrics.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index ffd911fea..62bddfbb3 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -56,8 +56,7 @@ def create(project_id, user_id, data: schemas.CreateCustomMetricsSchema): query ) r = cur.fetchone() - r = helper.dict_to_camel_case(r) - return {"data": r} + return {"data": get(metric_id=r["metric_id"], project_id=project_id, user_id=user_id)} def __get_series_id(metric_id): @@ -135,8 +134,7 @@ def update(metric_id, user_id, project_id, data: schemas.UpdateCustomMetricsSche query ) r = cur.fetchone() - r = helper.dict_to_camel_case(r) - return r + return get(metric_id=metric_id, project_id=project_id, user_id=user_id) def get_all(project_id, user_id):