Skip to content

Comments

feat: add review functionality#116

Closed
Matios102 wants to merge 2 commits intomasterfrom
fix/order-status-update
Closed

feat: add review functionality#116
Matios102 wants to merge 2 commits intomasterfrom
fix/order-status-update

Conversation

@Matios102
Copy link
Contributor

This pull request refactors the OrdersTable component 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 the orders prop, along with introducing router.refresh() to handle UI updates.

State Management Simplification:

  • Removed the localOrders state and its associated logic for updating the UI when marking orders as shipped. Instead, the orders prop is now used directly, simplifying the code. [1] [2]

  • Updated the handlePrintShippingLabel function to call router.refresh() after marking an order as shipped, ensuring the UI reflects the latest data without manually managing state.

Router Integration:

  • Imported useRouter from next/navigation and initialized it within the OrdersTable component to enable the use of router.refresh(). [1] [2]

@github-actions
Copy link

Coverage report

The coverage rate went from 88.0% to 88.37% ⬆️

The branch rate is 72.32%

100% of new lines are covered.

Diff Coverage details (click to unfold)

components/orders/orders-table.tsx

100.0% of new lines are covered

@Matios102 Matios102 force-pushed the fix/order-status-update branch from 0853f82 to 9467f18 Compare May 27, 2025 16:27
- 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,
@Matios102 Matios102 changed the title fix: remove local state management for orders and use router refresh feat: add review functionality May 27, 2025
@Matios102 Matios102 closed this May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant