Skip to content

Commit c7a3c6c

Browse files
committed
automatic capacity & sts id added in vehicle creation
1 parent c1733cd commit c7a3c6c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

client/components/dashboard-componenets/mainContent/stsManagerContents/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function STSManagerDashboard() {
2525
return (
2626
<main className="flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 max-h-[calc(100vh-60px)] overflow-scroll">
2727
<div className="flex items-center justify-between">
28-
<h1 className="text-lg font-semibold md:text-xl">STS DASHBOARD</h1>
28+
<h1 className="text-lg font-semibold md:text-xl hidden md:block">STS DASHBOARD</h1>
2929
<div className="flex-grow-1"></div>
3030
<div className="flex gap-2">
3131
<StsVehicleEntryModal>

client/components/dataTables/AllVehicleList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type Vehicle = {
6565
unloadedFuelCostPerKm: string,
6666
landFillId: string,
6767
landFillName: string,
68+
stsId: string,
6869
};
6970

7071
export const columns: ColumnDef<Vehicle>[] = [

client/hooks/entityCreation/useCreateVehicle.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type Vehicle = {
1111
loadedFuelCostPerKm: number;
1212
unloadedFuelCostPerKm: number;
1313
landFillId: string;
14+
stsId: string;
1415
};
1516

1617
export default function useCreateVehicle() {
@@ -24,11 +25,13 @@ export default function useCreateVehicle() {
2425
vehicleData.capacity > 0 &&
2526
vehicleData.loadedFuelCostPerKm !== null &&
2627
vehicleData.unloadedFuelCostPerKm !== null &&
27-
vehicleData.landFillId.length > 0
28+
vehicleData.landFillId.length > 0 &&
29+
vehicleData.stsId.length > 0
2830
);
2931
}
3032

3133
async function createVehicle(vehicleData: Vehicle) {
34+
// const {stsId, ...paylod} = vehicleData;
3235
if (vehicleData && isValid(vehicleData)) {
3336
try {
3437
const res = await axios.post(apiRoutes.vehicle.create, vehicleData, {

0 commit comments

Comments
 (0)