fix: error message kapasitas upload profile picture mentor

This commit is contained in:
Muhammad Zhafran Ilham
2026-06-25 23:06:17 +07:00
parent d444d18d45
commit 786f2530f1
@@ -56,11 +56,15 @@ const mentorProfileUploadErrorHandler = (err, req, res, next) => {
} }
if (err instanceof multer.MulterError) { if (err instanceof multer.MulterError) {
const message = err.code === 'LIMIT_FILE_SIZE'
? 'Profile picture maksimal 2MB'
: err.message;
return response( return response(
res, res,
'fail', 'fail',
error(new BadRequestError(err.message)), error(new BadRequestError(message)),
err.message, message,
ERROR.BAD_REQUEST ERROR.BAD_REQUEST
); );
} }