mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
24 lines
445 B
TypeScript
24 lines
445 B
TypeScript
import type { Role } from '@prisma/client';
|
|
|
|
import { prisma } from '@documenso/prisma';
|
|
|
|
export type UpdateUserOptions = {
|
|
id: number;
|
|
name: string | null | undefined;
|
|
email: string | undefined;
|
|
roles: Role[] | undefined;
|
|
};
|
|
|
|
export const updateUser = async ({ id, name, email, roles }: UpdateUserOptions) => {
|
|
await prisma.user.update({
|
|
where: {
|
|
id,
|
|
},
|
|
data: {
|
|
name,
|
|
email,
|
|
roles,
|
|
},
|
|
});
|
|
};
|