-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving routes page #2097
Improving routes page #2097
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for the contribution, @lcpichette! Regarding your question about using singular/plural, I'd say it all depends on how you called your content-type and controller 😅 The name/path of the file is what is important. If you used singular (for instance when you create the content-type either with the Content-Type Builder or with the You can also have a look at my screenshot, as a test I created a "livre" (singular) content-type and the code is using "livre": If, for some specific reasons, your "default" name is already plural (which I won't recommend), like creating a "tables" content-type, the uid will use this plural version: Oh, and we opted for a "generic" FYI the I understand this might all be a bit confusing and there are lots of pieces working together and customization possibilities. Your PR will be helpful (and I'll slightly tweak it to include the plugin use case). |
The PR is now approved, merged, should be live on docs.strapi.io in a few minutes, and will be mentioned in the next weekly snapshot release. |
What does it do?
Updated the handler names in the Configuration section and added a reference to a strapi command that allows you to view all existing routes and their current hierarchal order in the top-level/introductory section (above Implementation).
Why is it needed?
I was told in office hours that the existing handler name I had was incorrect, but it matched the docs. I was then suggested to use the following format
api::whatever.whatever.yourFunction
.Knowing what the api::whatever.whatever part is can be kind of confusing -- when do I use singular/plural for my collection-types? Do I use my file name or the collection name? I was told of a really helpful command to see if my routes exist -- and what they're labeled as (e.g. api::whatever.whatever):
yarn strapi routes:list
Related issue(s)/PR(s)
It is something I discovered was an issue during office hours.