add log for delet account
This commit is contained in:
@@ -3,6 +3,7 @@ import { prisma, Prisma } from "@repo/db";
|
||||
import bcrypt from "bcryptjs";
|
||||
import { sendMailByTemplate } from "../../../../helper/mail";
|
||||
import { getServerSession } from "api/auth/[...nextauth]/auth";
|
||||
import { logAction } from "(auth)/login/_components/action";
|
||||
|
||||
export const getUser = async (where: Prisma.UserWhereInput) => {
|
||||
return await prisma.user.findMany({
|
||||
@@ -58,6 +59,7 @@ export const deletePilotHistory = async (id: number) => {
|
||||
});
|
||||
};
|
||||
export const deleteUser = async (id: string) => {
|
||||
await logAction("ACCOUNT_DELETED");
|
||||
return await prisma.user.update({
|
||||
where: {
|
||||
id: id,
|
||||
|
||||
Reference in New Issue
Block a user