This commit is contained in:
Rao 2025-02-24 21:43:08 +08:00
commit 05b62881ef
1 changed files with 3 additions and 3 deletions

View File

@ -58,13 +58,13 @@ export class PostRouter {
const { staff } = ctx; const { staff } = ctx;
return await this.postService.update(input, staff); return await this.postService.update(input, staff);
}), }),
findById: this.trpc.protectProcedure findById: this.trpc.procedure
.input(z.object({ id: z.string(), args: PostFindFirstArgsSchema })) .input(z.object({ id: z.string(), args: PostFindFirstArgsSchema }))
.query(async ({ ctx, input }) => { .query(async ({ ctx, input }) => {
const { staff } = ctx; const { staff } = ctx;
return await this.postService.findById(input.id, input.args); return await this.postService.findById(input.id, input.args);
}), }),
findMany: this.trpc.protectProcedure findMany: this.trpc.procedure
.input(PostFindManyArgsSchema) .input(PostFindManyArgsSchema)
.query(async ({ ctx, input }) => { .query(async ({ ctx, input }) => {
const { staff } = ctx; const { staff } = ctx;
@ -84,7 +84,7 @@ export class PostRouter {
.mutation(async ({ input }) => { .mutation(async ({ input }) => {
return await this.postService.deleteMany(input); return await this.postService.deleteMany(input);
}), }),
findManyWithCursor: this.trpc.protectProcedure findManyWithCursor: this.trpc.procedure
.input( .input(
z.object({ z.object({
cursor: z.any().nullish(), cursor: z.any().nullish(),