Improve routes exposed

This commit is contained in:
Aurélien Georget 2016-08-16 11:09:06 +02:00
parent b83d81f61a
commit ecfa8ece41

View File

@ -50,17 +50,19 @@ module.exports = scope => {
policies: []
};
newRoutes.routes['POST /' + scope.humanizeId + '/:id/relationships/:relation'] = {
controller: scope.globalID,
action: 'createRelation',
policies: []
};
if (scope.template && scope.template !== 'mongoose') {
newRoutes.routes['POST /' + scope.humanizeId + '/:id/relationships/:relation'] = {
controller: scope.globalID,
action: 'createRelation',
policies: []
};
newRoutes.routes['DELETE /' + scope.humanizeId + '/:id/relationships/:relation'] = {
controller: scope.globalID,
action: 'destroyRelation',
policies: []
};
newRoutes.routes['DELETE /' + scope.humanizeId + '/:id/relationships/:relation'] = {
controller: scope.globalID,
action: 'destroyRelation',
policies: []
};
}
return newRoutes;
};