change error message for sending too many invitations to instruct them to email us

This commit is contained in:
Alys
2017-04-12 19:52:20 +10:00
committed by Sabe Jones
parent 8a2e6a98c2
commit fbda3a87ef
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
import { authWithHeaders } from '../../middlewares/auth';
import Bluebird from 'bluebird';
import _ from 'lodash';
import nconf from 'nconf';
import {
model as Group,
basicFields as basicGroupFields,
@@ -28,6 +29,7 @@ import shared from '../../../common';
import apiMessages from '../../libs/apiMessages';
const MAX_EMAIL_INVITES_BY_USER = 200;
const TECH_ASSISTANCE_EMAIL = nconf.get('EMAILS:TECH_ASSISTANCE_EMAIL');
/**
* @apiDefine GroupBodyInvalid
@@ -1058,7 +1060,7 @@ api.inviteToGroup = {
req.checkParams('groupId', res.t('groupIdRequired')).notEmpty();
if (user.invitesSent >= MAX_EMAIL_INVITES_BY_USER) throw new NotAuthorized(res.t('inviteLimitReached'));
if (user.invitesSent >= MAX_EMAIL_INVITES_BY_USER) throw new NotAuthorized(res.t('inviteLimitReached', { techAssistanceEmail: TECH_ASSISTANCE_EMAIL }));
let validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;