refactor: currencies service.

refactor: exchange rates service.
This commit is contained in:
Ahmed Bouhuolia
2020-09-26 16:23:57 +02:00
parent 986cd6b7a0
commit 933afb37bf
25 changed files with 878 additions and 401 deletions

View File

@@ -22,8 +22,8 @@ export default class InviteUsersController extends BaseController {
const router = Router();
router.post('/send', [
body('email').exists().trim().escape(),
],
body('email').exists().trim().escape(),
],
this.validationResult,
asyncMiddleware(this.sendInvite.bind(this)),
);
@@ -117,9 +117,7 @@ export default class InviteUsersController extends BaseController {
message: 'User invite has been accepted successfully.',
});
} catch (error) {
if (error instanceof ServiceError) {
if (error.errorType === 'phone_number_exists') {
return res.status(400).send({
errors: [{ type: 'PHONE_NUMBER.EXISTS' }],