fixing services and controller in user roles

This commit is contained in:
rafiarrafif
2025-05-07 03:15:32 +07:00
parent 40a7ffc005
commit c6367c3689
2 changed files with 4 additions and 7 deletions

View File

@ -1,11 +1,8 @@
import { Prisma } from "@prisma/client";
import { userRoleModel } from "../userRole.model";
import { handlePrismaError } from "../../../utils/databases/prisma/error/handler";
import { returnErrorResponse } from "../../../helpers/callback/httpResponse";
import { Context } from "elysia";
export const createUserRoleService = async (
ctx: Context,
userRoleData: Prisma.UserRoleUncheckedCreateInput
) => {
try {
@ -14,7 +11,6 @@ export const createUserRoleService = async (
});
return newUserRole;
} catch (error) {
const { status, message, details } = handlePrismaError(error);
throw returnErrorResponse(ctx.set, status, message, details);
return handlePrismaError(error);
}
};