Skip to content

Commit

Permalink
Add backend route to feature items
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew7li committed Aug 4, 2023
1 parent 21f6561 commit 059128b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/server/api/routers/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ export const contentRouter = createTRPCRouter({
});
}),

toggleFeaturedContent: protectedProcedure
.input(
z.object({
id: z.string(),
isFeatured: z.boolean(),
})
)
.mutation(({ input, ctx }) => {
return ctx.prisma.content.update({
where: {
id: input.id,
},
data: {
isFeatured: input.isFeatured,
},
});
}),

deleteContent: protectedProcedure
.input(
z.object({
Expand Down

0 comments on commit 059128b

Please sign in to comment.