3 var debug = require('debug')('gitter:api:invite-user-suggestions');
4 var collaboratorsService = require('gitter-web-collaborators');
6 function resolveInviteUserSuggestions(req, res, next) {
7 // null, 'GH_REPO', 'GH_ORG'
8 var type = req.query.type;
9 var linkPath = req.query.linkPath;
11 return collaboratorsService
12 .findCollaborators(req.user, type, linkPath)
13 .then(function(suggestions) {
14 debug('suggestions', suggestions);
15 res.send(suggestions);
17 .catch(function(err) {
18 debug('err', err, err.stack);
24 module.exports = resolveInviteUserSuggestions;