This commit is contained in:
@@ -26,9 +26,13 @@ export default function (fastify: FastifyInstance) {
|
||||
})
|
||||
const input = schema.parse(req.body)
|
||||
|
||||
return prisma.userPreferences.update({
|
||||
return prisma.userPreferences.upsert({
|
||||
where: { userId: req.user.id },
|
||||
data: input,
|
||||
create: {
|
||||
userId: req.user.id,
|
||||
...input,
|
||||
},
|
||||
update: input,
|
||||
})
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user