add default value in forwarder error

This commit is contained in:
2025-05-27 05:10:27 +07:00
parent a7c984b316
commit 85bc85618b
11 changed files with 81 additions and 48 deletions

View File

@ -1,26 +1,33 @@
import { AppError } from "../../../helpers/error/instances/app";
import { prisma } from "../../../utils/databases/prisma/connection";
export const findUniqueUserSessionInDBRepo = async (identifier: string) => {
const userSession = await prisma.userSession.findUnique({
where: {
id: identifier,
},
include: {
user: {
omit: {
password: true,
updatedAt: true,
},
include: {
roles: true,
try {
const userSession = await prisma.userSession.findUnique({
where: {
id: identifier,
},
include: {
user: {
omit: {
password: true,
updatedAt: true,
},
include: {
roles: true,
},
},
},
},
omit: {
deletedAt: true,
updatedAt: true,
},
});
omit: {
deletedAt: true,
updatedAt: true,
},
});
return userSession;
if (!userSession) return false;
return userSession;
} catch (error) {
throw new AppError(500, "Database Error", error);
}
};