fix: add prisma to forwarder error instance

This commit is contained in:
2025-05-27 23:37:24 +07:00
parent ab84abf366
commit b52f1202eb
6 changed files with 17 additions and 7 deletions

View File

@ -1,11 +1,12 @@
import { Prisma } from "@prisma/client";
import { userSessionModel } from "../userSession.model";
import { AppError } from "../../../helpers/error/instances/app";
export const createUserSessionRepo = async (
data: Prisma.UserSessionUncheckedCreateInput
) => {
try {
const newUserRole = await userSessionModel.create({
const newUserSession = await userSessionModel.create({
data: data,
include: {
user: {
@ -24,7 +25,7 @@ export const createUserSessionRepo = async (
updatedAt: true,
},
});
return newUserRole;
return newUserSession;
} catch (error) {
throw error;
}