提交 a23fe2c3 编写于 作者: J Jim LAURIE

Remove relations route from bookshelf template

上级 b0434c9e
......@@ -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;
}
......
......@@ -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);
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册