user preferences
All checks were successful
Deploy / deploy (push) Successful in 35s

This commit is contained in:
2025-12-25 21:27:54 +06:00
parent 2cbc75d7e3
commit 37683c42a9

View File

@@ -26,9 +26,13 @@ export default function (fastify: FastifyInstance) {
}) })
const input = schema.parse(req.body) const input = schema.parse(req.body)
return prisma.userPreferences.update({ return prisma.userPreferences.upsert({
where: { userId: req.user.id }, where: { userId: req.user.id },
data: input, create: {
userId: req.user.id,
...input,
},
update: input,
}) })
} }
catch (err) { catch (err) {