-
Notifications
You must be signed in to change notification settings - Fork 4
fix: amend customercases preview component, use initial data from server and fetch live data from client #1475
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c968375 to
1ca173b
Compare
anemne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙌
1ca173b to
5d95867
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug related to the preview functionality for customer cases by refactoring data fetching logic and improving error handling in the page builder schema.
Key Changes:
- Refactored customer cases data fetching from server component to preview component using
useQuery - Updated pageBuilder prepare function to handle uninitialized fields gracefully instead of throwing errors
- Modified CustomerCases component from async server component to synchronous client component
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| studio/schemas/documents/pageBuilder.ts | Replaced type-checking errors with defensive null handling for title/slug fields |
| src/components/customerCases/CustomerCasesPreview.tsx | Added useQuery hook for customer cases list data with proper initial data handling |
| src/components/customerCases/CustomerCases.tsx | Converted from async server component to synchronous component receiving data as props |
| src/app/(main)/[locale]/[...path]/page.tsx | Added customer cases data fetching logic for both draft and production modes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1274074 to
43dc0c3
Compare
43dc0c3 to
e9564a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e9564a4 to
3a3c28c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3a3c28c to
549258b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
549258b to
4bea3d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4bea3d3 to
d0f3dda
Compare
d0f3dda to
b510f77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…fetch updates clientside fix: query customercases data server side, fetch updates clientside
b510f77 to
906b925
Compare
Checklist
utilsdirectory