strapi icon indicating copy to clipboard operation
strapi copied to clipboard

Multi word with hyphen in API route as strapi entity

Open maloua opened this issue 3 years ago • 0 comments

Wondering how to use a multi-word api route where there's a hyphen in the path

My case: I have a route called /press-releases, registered in nuxt.config.js under entities. I can't use this.$strapi.$press-releases in the application though, and didn't find a workaround to specify the URL path for an entity.

What's the right way to do this? If there's no way, it would be neat if snakeCasing did the trick.

Current setup:

# nuxt.config.js

strapi: {
    entities: [{ name: 'press-releases', type: 'collection' }],
    ...
}
# pages/press.vue

# JS can't handle this
this.$strapi.$press-releases.find() 

maloua avatar Sep 01 '22 10:09 maloua