System Information
- Strapi: 4.20.5:
- OS: mac OS Sonoma 14.3.1:
- DB: sqlite:
- NPM: v20.0.0:
- Node: 9.6.4:
- Yarn: 1.22.22:
I am having trouble getting my Controller to call a core find
method for my fixture
api. I followed the documentation correctly.
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::fixture.fixture', ({ strapi }) => ({
async find(...args) {
console.log("hitting custom service")
return await strapi.service('api::fixture.fixture').find(args);
}
}))
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::fixture.fixture'), ({ strapi }) => ({
async find(...args) {
console.log("hit me!")
const {results, pagination} = await super.find(...args);
return {results, pagination};
},
});
After hitting http://localhost:1337/api/fixtures?populate=*
, it does not interact with the “hit me!” log i created, therefore this service is not being invoked at all.
Any ideas?