Skip to content

Issue #21 — Frontend: React Query Hooks for Member Bookings #705

@yusuftomilola

Description

@yusuftomilola

Location: frontend/lib/react-query/hooks/bookings/

Description

The member-facing bookings page and booking creation flow both need React Query hooks to communicate with the backend. This issue covers the two hooks a regular member needs: fetching their own bookings and creating a new one.

The project uses a shared apiClient at frontend/lib/apiClient.ts and centralised query keys in frontend/lib/react-query/keys/queryKeys.ts. Add any new keys there.

Acceptance Criteria

  • useGetMyBookings.ts — wraps GET /bookings with page, limit, and optional status filter params. Returns { data: Booking[], meta: { total, page, limit, totalPages } }
  • useCreateBooking.ts — wraps POST /bookings. Accepts the booking payload as the mutation variable. On success, invalidates the member bookings query so the list refreshes automatically
  • Both files are marked "use client" and placed under frontend/lib/react-query/hooks/bookings/
  • Query keys for member bookings are added to frontend/lib/react-query/keys/queryKeys.ts
  • npx tsc --noEmit passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions