feat: add colorscheme to user in db (#987)

This commit is contained in:
Meier Lukas
2024-09-01 20:37:52 +02:00
committed by GitHub
parent 824ec8a9ca
commit b080e0de71
28 changed files with 2869 additions and 58 deletions

View File

@@ -317,6 +317,14 @@ export const userRouter = createTRPCRouter({
})
.where(eq(users.id, input.userId));
}),
changeColorScheme: protectedProcedure.input(validation.user.changeColorScheme).mutation(async ({ input, ctx }) => {
await ctx.db
.update(users)
.set({
colorScheme: input.colorScheme,
})
.where(eq(users.id, ctx.session.user.id));
}),
});
const createUserAsync = async (db: Database, input: z.infer<typeof validation.user.create>) => {