feat: account

This commit is contained in:
Ivan Rezchikov
2026-06-23 15:32:52 +03:00
parent 64923cd1b2
commit 58ec75c948
18 changed files with 205 additions and 29 deletions
+16
View File
@@ -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 }
});
}