chore: changes

This commit is contained in:
pit
2023-10-05 11:38:51 +03:00
committed by Mythie
parent 9151055936
commit af73aee113
5 changed files with 37 additions and 56 deletions

View File

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