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