fix: error message kapasitas upload profile picture mentor
This commit is contained in:
@@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user