From 24e1f84ae833acd6f69e1ce94762c71b7b8c733b Mon Sep 17 00:00:00 2001 From: Data Salaryman Date: Tue, 16 Jul 2024 01:00:49 +0800 Subject: [PATCH] fix: use protected trpc procedure instead of public one --- .../extras/src/server/api/routers/post/with-auth-prisma.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/template/extras/src/server/api/routers/post/with-auth-prisma.ts b/cli/template/extras/src/server/api/routers/post/with-auth-prisma.ts index 088d0dc13d..287f5805a0 100644 --- a/cli/template/extras/src/server/api/routers/post/with-auth-prisma.ts +++ b/cli/template/extras/src/server/api/routers/post/with-auth-prisma.ts @@ -29,7 +29,7 @@ export const postRouter = createTRPCRouter({ }); }), - getLatest: publicProcedure.query(async ({ ctx }) => { + getLatest: protectedProcedure.query(async ({ ctx }) => { const post = ctx.db.post.findFirst({ orderBy: { createdAt: "desc" }, where: { createdBy: { id: ctx.session.user.id } },