feat(api): fixed autocomplete redundant values

This commit is contained in:
Taha Yassine Kraiem 2022-03-24 14:46:37 +01:00
parent 926e91e6cb
commit 77bf304fcd

View file

@ -432,7 +432,7 @@ def __get_autocomplete_table(value, project_id):
AND value ILIKE %(value)s
LIMIT 5)""")
with pg_client.PostgresClient() as cur:
query = cur.mogrify("UNION ALL".join(sub_queries) + ";",
query = cur.mogrify(" UNION ".join(sub_queries) + ";",
{"project_id": project_id, "value": helper.string_to_sql_like(value),
"svalue": helper.string_to_sql_like("^" + value)})
cur.execute(query)