System Information
- Strapi Version: v4.25.1
- Operating System: macOS - Sonoma 14.5
- Database: SQLite
- Node Version: v20.14.0
- NPM Version: 10.7.0
- IDE*: vscode 1.90.1
Hi,
I’m new to Strapi, i’ve created a new project with typescript and some content-types and everything is working well.
Now, i’m working on building a custom api route. I have created the folder structure of the api using the CLI and i’m building the service functions.
When calling the service from the controller i’m getting no suggestion of available services and methods, is this the expected behaviour?
I’m calling the service with the service method of the global strapi instance that has the following type definition: ‘(method) service(uid: Service): Service’
This is the controller:
/**
* A set of functions called "actions" for `cassa-in-cloud`
*/
export default {
authenticate: async (ctx, next) => {
const response = await strapi
.service("api::cassa-in-cloud.cassa-in-cloud") // (method) service(uid: Service): Service
.authenticate(); // (index) Service[string | number | symbol]: any
try {
ctx.body = response;
} catch (err) {
ctx.body = err;
}
}
};
Thank you