feat: Generate OGP #85
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.
This pull request includes several updates to enhance the handling of metadata, improve error responses, and update dependencies. The most important changes include adding metadata generation for club pages, improving error responses in the API route, and updating the package version.
Metadata Handling Improvements:
src/app/clubs/[...slug]/page.tsx: AddedgenerateMetadatafunction to dynamically generate metadata based on the club's data and user session. This includes handling different statuses (401, 403, 404) and setting appropriate metadata for the club pages. (src/app/clubs/[...slug]/page.tsxL2-R73)Error Response Enhancements:
src/app/api/clubs/[id]/route.ts: Improved error responses by including the status text in the JSON response when the status is not 200. (src/app/api/clubs/[id]/route.tsL13-R17)Dependency and Version Updates:
package.json: Updated the package version from2.1.14to2.2.0-alpha.1.Code Simplification:
src/components/clubPage/main.tsx: Removed theUpdateMetadatacomponent and its usage, as metadata is now handled ingenerateMetadata. [1] [2]Error Handling in Server Logic:
src/lib/server/club.ts: Enhanced error handling in thegetClubByIdfunction to return "unauthorized" for 401 status and "notfound" for 404 status.