mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 02:28:18 +00:00
fix
This commit is contained in:
@@ -19,13 +19,16 @@ const FUEL_TYPE_OPTIONS = [
|
||||
|
||||
const VEHICLE_STATUS_OPTIONS = [
|
||||
{ label: "Active", value: "ACTIVE" },
|
||||
{ label: "Free", value: "FREE" },
|
||||
{ label: "Busy", value: "BUSY" },
|
||||
{ label: "Maintenance", value: "MAINTENANCE" },
|
||||
{ label: "Retired", value: "RETIRED" },
|
||||
{ label: "Out of service", value: "OUT_OF_SERVICE" },
|
||||
];
|
||||
|
||||
const VEHICLE_AVAILABILITY_OPTIONS = [
|
||||
{ label: "Free", value: "FREE" },
|
||||
{ label: "Busy", value: "BUSY" },
|
||||
];
|
||||
|
||||
export const vehiclesConfig: FleetResourceConfig = {
|
||||
slug: "vehicles",
|
||||
label: "Vehicles",
|
||||
@@ -58,6 +61,7 @@ export const vehiclesConfig: FleetResourceConfig = {
|
||||
{ id: "capacity", header: "Capacity (tons)", accessorKey: "capacity", format: "number", size: 100 },
|
||||
{ id: "locationId", header: "Location", accessorKey: "locationId", size: 140 },
|
||||
{ id: "status", header: "Status", accessorKey: "status", format: "statusBadge", size: 100 },
|
||||
{ id: "availability", header: "Availability", accessorKey: "availability", format: "statusBadge", size: 100 },
|
||||
],
|
||||
formFields: [
|
||||
{ name: "code", label: "Code", type: "text" },
|
||||
@@ -95,4 +99,4 @@ export const vehiclesConfig: FleetResourceConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export { VEHICLE_TYPE_OPTIONS, FUEL_TYPE_OPTIONS, VEHICLE_STATUS_OPTIONS };
|
||||
export { VEHICLE_TYPE_OPTIONS, FUEL_TYPE_OPTIONS, VEHICLE_STATUS_OPTIONS, VEHICLE_AVAILABILITY_OPTIONS };
|
||||
|
||||
@@ -357,7 +357,7 @@ const FirstMilePage = () => {
|
||||
const { data: vehiclesData } = useQuery({
|
||||
queryKey: ["vehicles", "free"],
|
||||
queryFn: async () => {
|
||||
const res = await vehiclesService.getAll({ status: "FREE" });
|
||||
const res = await vehiclesService.getAll({ status: "ACTIVE", availability: "FREE" });
|
||||
return res.data;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -341,7 +341,7 @@ const LastMilePage = () => {
|
||||
const { data: vehiclesData } = useQuery({
|
||||
queryKey: ["vehicles", "free"],
|
||||
queryFn: async () => {
|
||||
const res = await vehiclesService.getAll({ status: "FREE" });
|
||||
const res = await vehiclesService.getAll({ status: "ACTIVE", availability: "FREE" });
|
||||
return res.data;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user