fixing in user and authentication

This commit is contained in:
rafiarrafif
2025-05-11 01:41:05 +07:00
parent 954d40df3b
commit 307c5e2d68
15 changed files with 122 additions and 96 deletions

View File

@ -1,10 +1,10 @@
import { handlePrismaError } from "../../../utils/databases/prisma/error/handler";
import {
returnErrorResponse,
returnReadResponse,
} from "../../../helpers/callback/httpResponse";
import { Context } from "elysia";
import { getAllUsersService } from "../services/getAllUser.service";
import { mainErrorHandler } from "../../../helpers/error/handler";
export const getAllUser = async (ctx: Context) => {
try {
@ -16,7 +16,6 @@ export const getAllUser = async (ctx: Context) => {
allUser
);
} catch (error) {
const { status, message, details } = handlePrismaError(error);
return returnErrorResponse(ctx.set, status, message, details);
return mainErrorHandler(ctx.set, error);
}
};