From e317d807f6af0c95930c2f7b89cb4028fb1dd9c0 Mon Sep 17 00:00:00 2001 From: MauricioGarciaS <47052044+MauricioGarciaS@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:31:44 +0100 Subject: [PATCH] Fixes for API response --- ee/api/chalicelib/core/signals.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ee/api/chalicelib/core/signals.py b/ee/api/chalicelib/core/signals.py index a1eb26c44..ed0664bde 100644 --- a/ee/api/chalicelib/core/signals.py +++ b/ee/api/chalicelib/core/signals.py @@ -13,10 +13,9 @@ def handle_frontend_signals(project_id: int, user_id: str, data: schemas_ee.Sign with pg_client.PostgresClient() as conn: query = conn.mogrify(insights_query, {'project_id': project_id, 'user_id': user_id, 'timestamp': data.timestamp, 'action': data.action, 'source': data.source, 'category': data.category, 'data': json.dumps(data.data)}) - logging.info(f'QUERY: {query}') conn.execute(query) # res = helper.dict_to_camel_case(conn.fetchone()) - return None + return {'data': 'insertion succeded'} except Exception as e: + logging.info(f'Error while inserting: {e}') return {'errors': [e]} - return None