Skip to content

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

Open
abhigyan24-ops wants to merge 1 commit 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 1 commit 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

- 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
@rdodiya
Copy link
Copy Markdown
Owner

rdodiya commented May 16, 2026

Hi @abhigyan24-ops .
Please resolve conflicts

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.

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

2 participants