mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 07:15:45 +00:00
feat(bookings): Integrate booking list and detail pages with backend API
This commit is contained in:
@@ -27,6 +27,8 @@ import {
|
||||
ruleEngineService,
|
||||
RuleEngineListParams,
|
||||
} from "./ruleEngine/ruleEngine.service";
|
||||
import { bookingsService, BookingListFilter } from "./bookings.service";
|
||||
import type { Freight, PaginatedResponse } from "@edr/types";
|
||||
|
||||
export const api = {
|
||||
fileUploadSettings: {
|
||||
@@ -220,4 +222,30 @@ export const api = {
|
||||
() => ruleEngineService.getApprovalChain(),
|
||||
),
|
||||
},
|
||||
|
||||
bookings: {
|
||||
list: endpoint<
|
||||
{ filter?: BookingListFilter },
|
||||
PaginatedResponse<Freight.IBooking>
|
||||
>("bookings", "list", ({ filter }) => bookingsService.list(filter)),
|
||||
|
||||
getById: endpoint<{ id: string }, Freight.IBooking>(
|
||||
"bookings",
|
||||
"getById",
|
||||
({ id }) => bookingsService.getById(id),
|
||||
),
|
||||
|
||||
updateStatus: endpoint<
|
||||
{ id: string; action: string; reason?: string },
|
||||
Freight.IBooking
|
||||
>("bookings", "updateStatus", ({ id, action, reason }) =>
|
||||
bookingsService.updateStatus(id, { action, reason }),
|
||||
),
|
||||
|
||||
remove: endpoint<{ id: string }, void>(
|
||||
"bookings",
|
||||
"remove",
|
||||
({ id }) => bookingsService.remove(id),
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user