// studentRouter
enrollStudent: authedProcedure
.input(
z.object({
id: z.string().cuid(),
classId: z.string().cuid(),
})
)
.mutation(async ({ ctx, input }) => {
try {
return await ctx.prisma.student.update({
where: { id: input.id },
data: {
id: input.id,
classes: {
connect: { id: input.classId }
}
}
})
} catch (error) {
// No error is thrown, the mutation fails silently
console.log(error)
}
}),
// studentRouter
enrollStudent: authedProcedure
.input(
z.object({
id: z.string().cuid(),
classId: z.string().cuid(),
})
)
.mutation(async ({ ctx, input }) => {
try {
return await ctx.prisma.student.update({
where: { id: input.id },
data: {
id: input.id,
classes: {
connect: { id: input.classId }
}
}
})
} catch (error) {
// No error is thrown, the mutation fails silently
console.log(error)
}
}),