mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 05:28:13 +00:00
refactor: modal for updating vehicles; global & modal styles changes
This commit is contained in:
@@ -183,28 +183,28 @@ function sortTableBy(id: string) {
|
||||
activeSortKey.value = id;
|
||||
}
|
||||
|
||||
// async function editRowPrimitive(row: IVehicleGroupTableRow, editKey: VehicleGroupEditRowKey) {
|
||||
// if (!(editKey in row.vehicleGroupRef)) return;
|
||||
async function editRowPrimitive(row: IVehicleGroupTableRow, editKey: VehicleGroupEditRowKey) {
|
||||
if (!(editKey in row.vehicleGroupRef)) return;
|
||||
|
||||
// let rowValue = row.vehicleGroupRef[editKey];
|
||||
let rowValue = row.vehicleGroupRef[editKey];
|
||||
|
||||
// if (typeof rowValue === 'string' || typeof rowValue === 'undefined' || rowValue == null) {
|
||||
// const promptValue = prompt('Zmień wartość:', rowValue ?? '');
|
||||
// if (promptValue == null) return;
|
||||
if (typeof rowValue === 'string' || typeof rowValue === 'undefined' || rowValue == null) {
|
||||
const promptValue = prompt('Zmień wartość:', rowValue ?? '');
|
||||
if (promptValue == null) return;
|
||||
|
||||
// const updatedData = await vehiclesStore.updateVehicle(row.vehicleGroupRef.id, editKey, promptValue);
|
||||
const updatedData = await vehiclesStore.updateVehicleGroup(row.vehicleGroupRef.id, editKey, promptValue);
|
||||
|
||||
// if (updatedData) {
|
||||
// (row.vehicleGroupRef[editKey] as any) = updatedData[editKey];
|
||||
// }
|
||||
// } else if (typeof rowValue == 'boolean') {
|
||||
// const updatedData = await vehiclesStore.updateVehicle(row.vehicleGroupRef.id, editKey, !rowValue);
|
||||
if (updatedData) {
|
||||
(row.vehicleGroupRef[editKey] as any) = updatedData[editKey];
|
||||
}
|
||||
} else if (typeof rowValue == 'boolean') {
|
||||
const updatedData = await vehiclesStore.updateVehicleGroup(row.vehicleGroupRef.id, editKey, !rowValue);
|
||||
|
||||
// if (updatedData) {
|
||||
// (row.vehicleGroupRef[editKey] as any) = updatedData[editKey];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (updatedData) {
|
||||
(row.vehicleGroupRef[editKey] as any) = updatedData[editKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function addVehicleGroupRow() {
|
||||
const data = await vehiclesStore.createVehicleGroup({
|
||||
|
||||
Reference in New Issue
Block a user