Collections Navigation Bug Fix#692
Conversation
✅ Deploy Preview for dailp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| // Navigate to the new collection or show success message | ||
| navigate(`/collections/${result.data.createEditedCollection}`) | ||
| navigate(`/collections/${newSlug}`) | ||
| } else { |
There was a problem hiding this comment.
After I create a new collection, I get taken to a blank page
There was a problem hiding this comment.
Based on the logs, it seems like creating the edited collection works, but it breaks when attempting to navigate to the new page (networkError: "TypeError: fetch failed")
There was a problem hiding this comment.
It seems like the collections here use the id for the collection page slugs (ex. new collection page slug is .../collections/dc0a8ad1-4901-4c19-88f9-6bd5e3cdd254) whereas use the collections usually use the name (/collections/cwkw).
There was a problem hiding this comment.
You might want to add a query to return the slug instead of the id or add a new query to fetch the slug
There was a problem hiding this comment.
The slug returning the id and navigating to what seems to be .../collections/dc0a8ad1-4901-4c19-88f9-6bd5e3cdd254 was there originally & was working perfectly fine before I made any changes. I reverted it back to the original--with the slug still returning the id--but I am happy to take a look at making the query return the slug instead of the ID if required @GracefulLemming
There was a problem hiding this comment.
That sounds good! I was just wondering if that was causing the issue
When creating an edited collection, the new collection now appears under Collections in the menu.
The error shown below happens in the dev environment only.
