Remove relations route from bookshelf template

This commit is contained in:
Jim LAURIE 2019-01-06 15:17:59 +01:00
parent b0434c9ea7
commit a23fe2c307
2 changed files with 0 additions and 55 deletions

View File

@ -64,31 +64,6 @@ module.exports = scope => {
}]
};
if (scope.args.tpl && scope.args.tpl !== 'mongoose') {
routes.routes.push({
method: 'POST',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.createRelation',
config: {
policies: []
}
}, {
method: 'PUT',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.updateRelation',
config: {
policies: []
}
}, {
method: 'DELETE',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.destroyRelation',
config: {
policies: []
}
});
}
return routes;
}

View File

@ -70,35 +70,5 @@ module.exports = {
destroy: async (ctx, next) => {
return strapi.services.<%= id %>.remove(ctx.params);
},
/**
* Add relation to a/an <%= id %> record.
*
* @return {Object}
*/
createRelation: async (ctx, next) => {
return strapi.services.<%= id %>.addRelation(ctx.params, ctx.request.body);
},
/**
* Update relation to a/an <%= id %> record.
*
* @return {Object}
*/
updateRelation: async (ctx, next) => {
return strapi.services.<%= id %>.editRelation(ctx.params, ctx.request.body);
},
/**
* Destroy relation to a/an <%= id %> record.
*
* @return {Object}
*/
destroyRelation: async (ctx, next) => {
return strapi.services.<%= id %>.removeRelation(ctx.params, ctx.request.body);
}
};