chore: improve the ui

This commit is contained in:
pit
2023-09-29 17:12:02 +01:00
committed by Mythie
parent 550b7e1655
commit eef720bf8c
4 changed files with 149 additions and 9 deletions

View File

@ -0,0 +1,30 @@
import { prisma } from '@documenso/prisma';
import { Role } from '@documenso/prisma/client';
export type UpdateUserOptions = {
userId: number;
name: string;
email: string;
roles: Role[];
};
export const updateUser = async ({ userId, name, email, roles }: UpdateUserOptions) => {
console.log('wtf');
await prisma.user.findFirstOrThrow({
where: {
id: userId,
},
});
const updatedUser = await prisma.user.update({
where: {
id: userId,
},
data: {
name,
email,
roles,
},
});
return updatedUser;
};