mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Support findOne request
This commit is contained in:
parent
78234fab61
commit
c59ad9d958
@ -267,7 +267,7 @@ module.exports = {
|
||||
return async (ctx, next) => {
|
||||
ctx.params = {
|
||||
...params,
|
||||
[model.primaryKey]: options.id
|
||||
[model.primaryKey]: ctx.params.id
|
||||
};
|
||||
|
||||
// Return the controller.
|
||||
@ -339,10 +339,10 @@ module.exports = {
|
||||
|
||||
// Resolver can be a function. Be also a native resolver or a controller's action.
|
||||
if (_.isFunction(resolver)) {
|
||||
if (isController) {
|
||||
context.query = this.convertToParams(options);
|
||||
context.params = options;
|
||||
context.query = this.convertToParams(options);
|
||||
context.params = options;
|
||||
|
||||
if (isController) {
|
||||
const values = await resolver.call(null, context);
|
||||
|
||||
if (ctx.body) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user