From 5738fd7bc70459429587bd972395617ca487a43f Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 6 Dec 2022 17:56:26 +0100 Subject: [PATCH] feat(chalice): get all webhooks --- api/chalicelib/core/webhook.py | 2 +- ee/api/chalicelib/core/webhook.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/chalicelib/core/webhook.py b/api/chalicelib/core/webhook.py index cd21364f6..e574fdf22 100644 --- a/api/chalicelib/core/webhook.py +++ b/api/chalicelib/core/webhook.py @@ -54,7 +54,7 @@ def get_by_tenant(tenant_id, replace_none=False): with pg_client.PostgresClient() as cur: cur.execute("""SELECT w.* FROM public.webhooks AS w - WHERE deleted_at ISNULL AND type='webhook';""") + WHERE deleted_at ISNULL;""") all = helper.list_to_camel_case(cur.fetchall()) for w in all: w["createdAt"] = TimeUTC.datetime_to_timestamp(w["createdAt"]) diff --git a/ee/api/chalicelib/core/webhook.py b/ee/api/chalicelib/core/webhook.py index 6f9b752db..d0fcdd6a1 100644 --- a/ee/api/chalicelib/core/webhook.py +++ b/ee/api/chalicelib/core/webhook.py @@ -58,8 +58,7 @@ def get_by_tenant(tenant_id, replace_none=False): cur.mogrify("""SELECT w.* FROM public.webhooks AS w WHERE w.tenant_id =%(tenant_id)s - AND deleted_at ISNULL - AND type='webhook';""", + AND deleted_at ISNULL;""", {"tenant_id": tenant_id}) ) all = helper.list_to_camel_case(cur.fetchall())