feat(chalice): get all webhooks

This commit is contained in:
Taha Yassine Kraiem 2022-12-06 17:56:26 +01:00
parent 24b6e91f6c
commit 5738fd7bc7
2 changed files with 2 additions and 3 deletions

View file

@ -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"])

View file

@ -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())