order number support
This commit is contained in:
@@ -10,20 +10,43 @@ export const linksRouter = createTRPCRouter({
|
||||
.input(
|
||||
z.object({
|
||||
name: z.string().min(1),
|
||||
url: z.string().min(1)
|
||||
url: z.string().min(1),
|
||||
orderNumber: z.number().optional()
|
||||
})
|
||||
)
|
||||
.mutation(async ({ctx, input}) => {
|
||||
return ctx.db.socialLink.create({
|
||||
data: {
|
||||
name: input.name,
|
||||
url: input.url
|
||||
url: input.url,
|
||||
orderNumber: input.orderNumber
|
||||
}
|
||||
})
|
||||
}),
|
||||
update: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
id: z.number(),
|
||||
name: z.string().min(1).optional(),
|
||||
url: z.string().min(1).optional(),
|
||||
orderNumber: z.number().optional(),
|
||||
})
|
||||
)
|
||||
.mutation(async ({ctx, input}) => {
|
||||
return ctx.db.socialLink.update({
|
||||
data: {
|
||||
name: input.name,
|
||||
url: input.url,
|
||||
orderNumber: input.orderNumber
|
||||
},
|
||||
where: {
|
||||
id: input.id
|
||||
}
|
||||
})
|
||||
}),
|
||||
delete: protectedProcedure
|
||||
.input(
|
||||
z.string().min(1)
|
||||
z.number().min(1)
|
||||
)
|
||||
.mutation(async ({ctx, input}) => {
|
||||
return ctx.db.socialLink.delete({
|
||||
|
||||
Reference in New Issue
Block a user