chore: implement feedback

This commit is contained in:
pit
2023-10-12 12:19:23 +03:00
committed by Mythie
parent 9932d805b7
commit 39c2bf77c2
7 changed files with 38 additions and 28 deletions

View File

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