diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee index 675399c898..985adb6704 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee @@ -15,7 +15,7 @@ module.exports = CollaboratorsInviteController = LimitationsManager.canAddXCollaborators project_id, 1, (error, allowed) => return next(error) if error? if !allowed - logger.log {projectId, email, sendingUserId}, "not allowed to invite any more users to this project" + logger.log {projectId, email, sendingUserId}, "not allowed to invite more users to project" return res.json {} {email, privileges} = req.body email = mimelib.parseAddresses(email or "")[0]?.address?.toLowerCase() @@ -30,7 +30,18 @@ module.exports = CollaboratorsInviteController = return res.json {inviteId: invite._id} revokeInvite: (req, res, next) -> + projectId = req.params.Project_id + inviteId = req.params.invite_id + logger.log {projectId, inviteId}, "revoking invite" + CollaboratorsInviteHandler.revokeInvite projectId, inviteId, (err) -> + if err? + logger.err {projectId, inviteId}, "error revoking invite" + return next(err) + res.status(201).send() viewInvite: (req, res, next) -> + projectId = req.params.Project_id + token = req.params.token + acceptInvite: (req, res, next) -> diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee index 3b4c9617c6..f3d09effd4 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteHandler.coffee @@ -1,9 +1,9 @@ module.experts = CollaboratorsInviteHandler = - inviteToProject: (callback) -> + inviteToProject: (projectId, sendingUserId, email, priveleges, callback=(err,invite)->) -> - revokeInvite: (callback) -> + revokeInvite: (projectId, inviteId, callback=(err)->) -> - viewInvite: (callback) -> + getInviteByToken: (projectId, tokenString, callback=(err,invite)->) -> - acceptInvite: (callback) -> + acceptInvite: (projectId, inviteId, callback=(err)->) -> diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee index c2357994a3..c687a1e487 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee @@ -24,7 +24,7 @@ module.exports = ) webRouter.get( - '/project/:Project_id/invite/token/:token_id', + '/project/:Project_id/invite/token/:token', CollaboratorsInviteController.viewInvite )