strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
https://strapi.io
Other
60.67k stars 7.58k forks source link

Single Type Leads To 404 NotFoundError #20205

Open simwai opened 2 weeks ago

simwai commented 2 weeks ago

Bug report

Required System information

Describe the bug

I converted a collection type (intro) into a single type. Afterward, I wasn't able to receive the content anymore. I looked through the issues a little bit and saw a similar issue where it could be solved by using populate, which didn't work out for me.

In Postman I tried these calls: GET http://localhost:13370/api/intro GET http://localhost:13370/api/intros GET http://localhost:13370/api/intro?populate= GET http://localhost:13370/api/intros?populate= 

They all failed with that response: {   "data": null,   "error": {     "status": 404,     "name": "NotFoundError",     "message": "Not Found",     "details": {}   } }

I correctly set the permissions and the bearer token, because all requests on collection type work well.

Steps to reproduce the behavior

  1. Go to "Content-Type Builder"
  2. Click on "Create a collection"
  3. Enter test into the "Display name" field
  4. Select "Text" field
  5. Select "Short text"
  6. Enter as name "test"
  7. Click "Finish"
  8. Click "Save"
  9. Wait for reboot
  10. Go to "Content Manager"
  11. Go to collection type "test"
  12. Click "Create new entry"
  13. Enter as value "test"
  14. Click "Edit the model"
  15. Click "Edit"
  16. Switch from "Collection Type" to "Single Type"
  17. Click "Finish"
  18. Wait for reboot
  19. Go to "Content Manager"
  20. Go to single type "test"
  21. Click "Publish"
  22. Go to postman and do the 4 GET calls I mentioned above.
  23. You see 404 NotFoundError on each response.

Expected behavior

I expect to get the data back I entered into the entry of a single type without 404 error.