mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix: update booking data structure to use meta.total and add null coalescing for checkbox states
This commit is contained in:
@@ -235,7 +235,7 @@ function useStatusCount(statuses: string | undefined): number | undefined {
|
||||
staleTime: 30_000,
|
||||
}),
|
||||
);
|
||||
return data?.total;
|
||||
return data?.meta?.total;
|
||||
}
|
||||
|
||||
function StatCard({
|
||||
@@ -354,7 +354,7 @@ export default function MyBookings() {
|
||||
};
|
||||
|
||||
const allItems = data?.items ?? [];
|
||||
const total = data?.total ?? allItems.length;
|
||||
const total = data?.meta?.total ?? allItems.length;
|
||||
|
||||
// Server handles status + pagination; reference search is applied on the page.
|
||||
const rows = useMemo(() => {
|
||||
|
||||
@@ -115,7 +115,7 @@ export function Step2ServiceType({
|
||||
icon={<Truck size={18} />}
|
||||
title="First Mile — Pick-up"
|
||||
description="Truck pick-up from your premises (Door to Port) to the origin rail yard."
|
||||
checked={field.value}
|
||||
checked={field.value ?? false}
|
||||
onChange={(value) => {
|
||||
field.onChange(value);
|
||||
if (!value) {
|
||||
@@ -157,7 +157,7 @@ export function Step2ServiceType({
|
||||
icon={<Truck size={18} />}
|
||||
title="Last Mile — Delivery"
|
||||
description="Truck delivery from the destination rail yard to the final address (Port to Door)."
|
||||
checked={field.value}
|
||||
checked={field.value ?? false}
|
||||
onChange={(value) => {
|
||||
field.onChange(value);
|
||||
if (!value) {
|
||||
@@ -225,7 +225,7 @@ export function Step2ServiceType({
|
||||
icon={<FileText size={18} />}
|
||||
title="Customs Clearing Service"
|
||||
description="EDR handles customs documentation and clearance on your behalf."
|
||||
checked={field.value}
|
||||
checked={field.value ?? false}
|
||||
onChange={(v) => field.onChange(v)}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user