feat: improve admin panel

This commit is contained in:
Mythie
2024-03-03 01:55:33 +11:00
parent 328d16483c
commit 73aae6f1e3
19 changed files with 824 additions and 169 deletions

View File

@ -4,20 +4,18 @@ import { DocumentStatus } from '@documenso/prisma/client';
import { deletedAccountServiceAccount } from './service-accounts/deleted-account';
export type DeleteUserOptions = {
email: string;
id: number;
};
export const deleteUser = async ({ email }: DeleteUserOptions) => {
export const deleteUser = async ({ id }: DeleteUserOptions) => {
const user = await prisma.user.findFirst({
where: {
email: {
contains: email,
},
id,
},
});
if (!user) {
throw new Error(`User with email ${email} not found`);
throw new Error(`User with ID ${id} not found`);
}
const serviceAccount = await deletedAccountServiceAccount();