Skip to content

Commit

Permalink
fix: use protected trpc procedure instead of public one
Browse files Browse the repository at this point in the history
  • Loading branch information
datasalaryman committed Jul 15, 2024
1 parent da2a46c commit 5277bd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down

0 comments on commit 5277bd2

Please sign in to comment.