diff --git a/cli/template/extras/src/server/api/routers/post/with-auth-drizzle.ts b/cli/template/extras/src/server/api/routers/post/with-auth-drizzle.ts index 138e47a394..d01bc1cf85 100644 --- a/cli/template/extras/src/server/api/routers/post/with-auth-drizzle.ts +++ b/cli/template/extras/src/server/api/routers/post/with-auth-drizzle.ts @@ -28,7 +28,7 @@ export const postRouter = createTRPCRouter({ }); }), - getLatest: publicProcedure.query(({ ctx }) => { + getLatest: protectedProcedure.query(({ ctx }) => { const post = ctx.db.query.posts.findFirst({ orderBy: (posts, { desc }) => [desc(posts.createdAt)], }); 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 } },