Closed
Conversation
Coverage reportThe coverage rate went from The branch rate is
Diff Coverage details (click to unfold)components/orders/orders-table.tsx
|
0853f82 to
9467f18
Compare
- Updated the orders schema to include a relation to reviews. - Created actions for adding and retrieving reviews - Added Add review button to orders table. - Added functionality to submit reviews,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 refactors the
OrdersTablecomponent to simplify state management and improve the user experience by leveraging the Next.js router for refreshing data. The most significant changes involve removing the local state for orders and replacing it with direct use of theordersprop, along with introducingrouter.refresh()to handle UI updates.State Management Simplification:
Removed the
localOrdersstate and its associated logic for updating the UI when marking orders as shipped. Instead, theordersprop is now used directly, simplifying the code. [1] [2]Updated the
handlePrintShippingLabelfunction to callrouter.refresh()after marking an order as shipped, ensuring the UI reflects the latest data without manually managing state.Router Integration:
useRouterfromnext/navigationand initialized it within theOrdersTablecomponent to enable the use ofrouter.refresh(). [1] [2]