From 21dd9c5a9f1403d5cf7dcdc67a61a669d8566e96 Mon Sep 17 00:00:00 2001 From: kohinoor-nimes Date: Tue, 29 Oct 2024 19:09:27 +0530 Subject: [PATCH] fix: overridepage soft delete (#2341) const namespace = await db.query.ratelimitNamespaces.findFirst({ where: (table, { eq, and, isNull }) => and( eq(table.id, props.params.namespaceId), isNull(table.deletedAt) ), with: { overrides: { columns: { id: true, identifier: true, limit: true, duration: true, async: true, }, where: (table, { isNull }) => // excluding soft deletes columns isNull(table.deletedAt) }, workspace: { columns: { id: true, tenantId: true, features: true, }, }, }, }); --- .../app/(app)/ratelimits/[namespaceId]/overrides/page.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx index 630b25a188..8ebe9e51c7 100644 --- a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx +++ b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx @@ -23,7 +23,10 @@ export default async function OverridePage(props: Props) { const namespace = await db.query.ratelimitNamespaces.findFirst({ where: (table, { eq, and, isNull }) => - and(eq(table.id, props.params.namespaceId), isNull(table.deletedAt)), + and( + eq(table.id, props.params.namespaceId), + isNull(table.deletedAt) + ), with: { overrides: { columns: { @@ -33,8 +36,9 @@ export default async function OverridePage(props: Props) { duration: true, async: true, }, + where: (table, { isNull }) => + isNull(table.deletedAt) }, - workspace: { columns: { id: true,