mirror of
https://github.com/strapi/strapi.git
synced 2025-11-16 01:57:56 +00:00
Remove relations route from bookshelf template
This commit is contained in:
parent
b0434c9ea7
commit
a23fe2c307
@ -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;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -70,35 +70,5 @@ module.exports = {
|
|||||||
|
|
||||||
destroy: async (ctx, next) => {
|
destroy: async (ctx, next) => {
|
||||||
return strapi.services.<%= id %>.remove(ctx.params);
|
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);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user