From aa0c29e7d5f7a58f6e764cdcfabe236dd145fd41 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Wed, 9 Mar 2022 17:55:27 +0100 Subject: [PATCH] feat(api): optimized autocomplete for errors --- api/chalicelib/core/events.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/chalicelib/core/events.py b/api/chalicelib/core/events.py index 35baea430..c93cb9917 100644 --- a/api/chalicelib/core/events.py +++ b/api/chalicelib/core/events.py @@ -19,6 +19,7 @@ def get_customs_by_sessionId2_pg(session_id, project_id): {"project_id": project_id, "session_id": session_id}) ) rows = cur.fetchall() + rows = cur.fetchall() return helper.dict_to_camel_case(rows) @@ -106,6 +107,7 @@ def __pg_errors_query(source=None): WHERE s.project_id = %(project_id)s AND lg.message ILIKE %(svalue)s + AND lg.project_id = %(project_id)s {"AND source = %(source)s" if source is not None else ""} LIMIT 5) UNION ALL @@ -117,6 +119,7 @@ def __pg_errors_query(source=None): WHERE s.project_id = %(project_id)s AND lg.name ILIKE %(svalue)s + AND lg.project_id = %(project_id)s {"AND source = %(source)s" if source is not None else ""} LIMIT 5) UNION @@ -128,6 +131,7 @@ def __pg_errors_query(source=None): WHERE s.project_id = %(project_id)s AND lg.message ILIKE %(value)s + AND lg.project_id = %(project_id)s {"AND source = %(source)s" if source is not None else ""} LIMIT 5) UNION ALL @@ -139,6 +143,7 @@ def __pg_errors_query(source=None): WHERE s.project_id = %(project_id)s AND lg.name ILIKE %(value)s + AND lg.project_id = %(project_id)s {"AND source = %(source)s" if source is not None else ""} LIMIT 5));"""