Skip to content

fix: integrate order status update API with frontend UI#63

Open
abhigyan24-ops wants to merge 2 commits into
rdodiya:gssoc_developfrom
abhigyan24-ops:fix/order-status-api-integration
Open

fix: integrate order status update API with frontend UI#63
abhigyan24-ops wants to merge 2 commits into
rdodiya:gssoc_developfrom
abhigyan24-ops:fix/order-status-api-integration

Conversation

@abhigyan24-ops
Copy link
Copy Markdown
Contributor

Fixes #51

What changed

Frontend (OrderCard.jsx)

  • Added API call to PATCH /secure/api/v1/orders/{id}/status when status button is clicked
  • Added status mapping from frontend labels to backend OrderStatus enum:
    • pending → PENDING
    • cooking → PREPARING
    • ready → READY
    • billed → COMPLETED
    • complete → COMPLETED
  • Handles loading and error states during API call

Frontend (OrdersGrid.jsx)

  • Fetch active orders from GET /secure/api/v1/orders/branch/1/active on mount
  • Falls back to mock data when API returns empty array or is unavailable
  • Syncs order state to parent for filter count updates

Testing

  • UI status updates work correctly with mock data
  • API integration wired to correct backend endpoints
  • Error handling in place for failed requests

@rdodiya
Copy link
Copy Markdown
Owner

rdodiya commented May 16, 2026

Hi @abhigyan24-ops .
Please resolve conflicts

- Add API call to PATCH /secure/api/v1/orders/{id}/status on status change
- Map frontend status labels to backend OrderStatus enum values
- Add fallback to mock data when API returns empty or unavailable
- Fetch active orders from backend on component mount

Fixes rdodiya#51
@abhigyan24-ops abhigyan24-ops force-pushed the fix/order-status-api-integration branch from 9758b71 to c5d204b Compare May 18, 2026 18:28
@abhigyan24-ops
Copy link
Copy Markdown
Contributor Author

Hi @rdodiya, conflict has been resolved! PR is ready for review

@rdodiya
Copy link
Copy Markdown
Owner

rdodiya commented May 20, 2026

Hi @abhigyan24-ops ,
Please do not remove comments and please do not format the existing code, and perform the changes mentioned above and provide updated PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend + Frontend] Implement Order Status Update API Integration with UI

2 participants