@@ -5,7 +5,7 @@ class InvitationController extends CrudController {
5
5
invite = async ( req , res , next ) => {
6
6
try {
7
7
if ( ! ( "organisationId" in req . body && "emailList" in req . body ) ) {
8
- throw "Missing parameters" ;
8
+ throw FliptaskError . missingParams ( ) ;
9
9
}
10
10
req . body . createdBy = req . user . id ;
11
11
const data = await this . service . inviteMany ( req . body ) ;
@@ -18,7 +18,7 @@ class InvitationController extends CrudController {
18
18
details = async ( req , res , next ) => {
19
19
try {
20
20
if ( ! ( "link" in req . query ) ) {
21
- throw "Missing parameters" ;
21
+ throw FliptaskError . missingParams ( ) ;
22
22
}
23
23
const data = await this . service . details ( req . query . link ) ;
24
24
Response . success ( res , data ) ;
@@ -32,7 +32,7 @@ class InvitationController extends CrudController {
32
32
const { user, body } = req ;
33
33
const { link, accept } = body ;
34
34
if ( ! ( link && accept ) ) {
35
- throw "Missing parameters" ;
35
+ throw FliptaskError . missingParams ( ) ;
36
36
}
37
37
const data = await this . service . resolve ( { user, link, accept } ) ;
38
38
Response . success ( res , data ) ;
0 commit comments