Skip to content

Commit c97c4cb

Browse files
authored
Fix usage in services (#1695)
Related to #1691
1 parent f84592b commit c97c4cb

File tree

1 file changed

+4
-2
lines changed
  • docusaurus/docs/dev-docs/backend-customization

1 file changed

+4
-2
lines changed

docusaurus/docs/dev-docs/backend-customization/services.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,13 @@ Once a service is created, it's accessible from [controllers](/dev-docs/backend-
400400

401401
```js
402402
// access an API service
403-
strapi.service('api::apiName.serviceName');
403+
strapi.service('api::apiName.serviceName').FunctionName();
404404
// access a plugin service
405-
strapi.service('plugin::pluginName.serviceName');
405+
strapi.service('plugin::pluginName.serviceName').FunctionName();
406406
```
407407

408+
In the syntax examples above, `serviceName` is the name of the service file for API services or the name used to export the service file to `services/index.js` for plugin services.
409+
408410
:::tip
409411
To list all the available services, run `yarn strapi services:list`.
410412
:::

0 commit comments

Comments
 (0)