Include Profile log in renamed penalty model -> Audit log
This commit is contained in:
@@ -58,10 +58,13 @@ export const deletePilotHistory = async (id: number) => {
|
||||
});
|
||||
};
|
||||
export const deleteUser = async (id: string) => {
|
||||
return await prisma.user.delete({
|
||||
return await prisma.user.update({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
data: {
|
||||
isDeleted: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ const page = async () => {
|
||||
if (!user) return null;
|
||||
|
||||
const events = await prisma.event.findMany({
|
||||
orderBy: {
|
||||
id: "desc",
|
||||
},
|
||||
where: {
|
||||
hidden: false,
|
||||
},
|
||||
|
||||
@@ -23,6 +23,7 @@ export const options: AuthOptions = {
|
||||
contains: credentials.email,
|
||||
mode: "insensitive",
|
||||
},
|
||||
isDeleted: false,
|
||||
},
|
||||
});
|
||||
const v1User = (oldUser as OldUser[]).find(
|
||||
@@ -87,6 +88,7 @@ export const options: AuthOptions = {
|
||||
const dbUser = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: token?.sub,
|
||||
isDeleted: false,
|
||||
},
|
||||
});
|
||||
if (!dbUser) {
|
||||
|
||||
Reference in New Issue
Block a user