Merge branch 'feat/refresh' into fix/467-bugsafari-only-unable-to-copy-document-sharing-link

This commit is contained in:
David Nguyen
2023-10-16 12:45:05 +11:00
49 changed files with 2032 additions and 73 deletions

View File

@ -0,0 +1,25 @@
import { prisma } from '@documenso/prisma';
export type DeleteUserOptions = {
email: string;
};
export const deleteUser = async ({ email }: DeleteUserOptions) => {
const user = await prisma.user.findFirst({
where: {
email: {
contains: email,
},
},
});
if (!user) {
throw new Error(`User with email ${email} not found`);
}
return await prisma.user.delete({
where: {
id: user.id,
},
});
};