Fix audio collection page SSR error #4722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extract common functionality to a composable
Fixes
Fixes #4721 by @obulat
Description
This PR fixes the audio collection SSR by setting the media to the media from the store (instead of the empty array).
It also extracts the collection functionality into a composable. This reduces the code duplication between the audio/image collection pages.
Another fix in this PR is the re-addition of the
creatorUrl
prop. This prop was lost when migrating to Nuxt 3, and the creator collections did not have the link to their landing pages on source websites.Testing Instructions
Run the app.
Search for something in audio, and then click on one of the tags. Refresh the page to see how SSR page looks. On
main
and in production, the page does not show any results, and there is an error logged in the console. In this PR, the page works correctly. Note that the image collections work well both in production and here.Check a creator collection page. On
main
and in production, the page does not have a creator link button in the header. In this PR, the link is shown (both in the image and in the audio page)Checklist
Update index.md
).main
) or a parent feature branch.ov just catalog/generate-docs
for catalogPRs) or the media properties generator (
ov just catalog/generate-docs media-props
for the catalog or
ov just api/generate-docs
for the API) where applicable.Developer Certificate of Origin
Developer Certificate of Origin