Skip to content

Commit

Permalink
feat(api): filter deleted checkouts (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-yato authored Oct 10, 2024
1 parent c03933c commit c7f75c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/service/checkout.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { count, desc, eq } from "drizzle-orm";
import { and, count, desc, eq, isNull } from "drizzle-orm";
import type { User } from "lucia";
import { z } from "@hono/zod-openapi";
import { err, ok, type Result } from "@justmiracle/result";
Expand Down Expand Up @@ -160,7 +160,7 @@ export class CheckoutService {
}

async findMany(userId: string, opts: { page: number; perPage: number }) {
const condition = eq(TB_checkout.userId, userId);
const condition = and(eq(TB_checkout.userId, userId), isNull(TB_checkout.deletedAt));

const query = db.query.TB_checkout.findMany({
where: condition,
Expand Down

0 comments on commit c7f75c7

Please sign in to comment.