Skip to content

Commit

Permalink
fix: overridepage soft delete (#2341)
Browse files Browse the repository at this point in the history
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,
        },
      },
    },
  });
  • Loading branch information
kohi9noor authored Oct 29, 2024
1 parent 326964e commit 21dd9c5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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,
Expand Down

0 comments on commit 21dd9c5

Please sign in to comment.