3 var groupRoomSuggestions = require('gitter-web-groups/lib/group-room-suggestions');
4 var restSerializer = require('../../../serializers/rest-serializer');
8 if (!req.group) return [];
10 if (!req.user) return [];
12 var userId = req.user._id;
14 return groupRoomSuggestions
15 .findUnjoinedRoomsInGroup(req.group._id, userId)
16 .then(function(suggestions) {
17 var strategy = restSerializer.TroupeStrategy.createSuggestionStrategy();
18 return restSerializer.serialize(suggestions, strategy);