I can find the answer to my first question myself, but I still have another question.
e.g.:
module.exports = createCoreController('api::cat.cat', ({ strapi }) => ({
...
// Method 1: Creating an entirely custom action
async exampleAction(ctx) {
try {
ctx.body = 'ok';
} catch (err) {
ctx.body = err;
}
},
};
How do I call “exampleAction(ctx)” in “cat” from “dog” controller?
module.exports = createCoreController('api::dog.dog', ({ strapi }) => ({
...
// How do I call “exampleAction(ctx)” in “cat” from "dog"?
...
};