feat: account
This commit is contained in:
@@ -31,4 +31,20 @@ export async function updateUser(id: string, data: Partial<Omit<UserData, "kotos
|
||||
...(data.birthDate ? { birthDate: new Date(data.birthDate) } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteUser(id: string) {
|
||||
await prisma.page.updateMany({
|
||||
where: { createdBy: id },
|
||||
data: { createdBy: null }
|
||||
});
|
||||
|
||||
await prisma.page.updateMany({
|
||||
where: { updatedBy: id },
|
||||
data: { updatedBy: null }
|
||||
});
|
||||
|
||||
await prisma.user.delete({
|
||||
where: { id }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user