mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactoring: custom views service.
fix: constraints of delete item from storage. fix: constraints of delete item category from storage. fix: localize database seeds files. fix: view meta data in accounts list response.
This commit is contained in:
@@ -222,19 +222,22 @@ export default class UsersController extends BaseController{
|
||||
}
|
||||
if (error instanceof ServiceError) {
|
||||
if (error.errorType === 'user_not_found') {
|
||||
return res.status(404).send({
|
||||
errors: [{ type: 'USER.NOT.FOUND', code: 100 }],
|
||||
});
|
||||
return res.boom.badRequest(
|
||||
'User not found.',
|
||||
{ errors: [{ type: 'USER.NOT.FOUND', code: 100 }] }
|
||||
);
|
||||
}
|
||||
if (error.errorType === 'user_already_active') {
|
||||
return res.status(404).send({
|
||||
errors: [{ type: 'USER.ALREADY.ACTIVE', code: 200 }],
|
||||
});
|
||||
return res.boom.badRequest(
|
||||
'User is already active.',
|
||||
{ errors: [{ type: 'USER.ALREADY.ACTIVE', code: 200 }] },
|
||||
);
|
||||
}
|
||||
if (error.errorType === 'user_already_inactive') {
|
||||
return res.status(404).send({
|
||||
errors: [{ type: 'USER.ALREADY.INACTIVE', code: 200 }],
|
||||
});
|
||||
return res.boom.badRequest(
|
||||
'User is already inactive.',
|
||||
{ errors: [{ type: 'USER.ALREADY.INACTIVE', code: 200 }] },
|
||||
);
|
||||
}
|
||||
if (error.errorType === 'user_same_the_authorized_user') {
|
||||
return res.boom.badRequest(
|
||||
|
||||
Reference in New Issue
Block a user