CEC-4341 - Fix Can signal export select all (#340)
* CEC-4341 - Fix Can signal export select all * fix code smell
This commit is contained in:
@@ -23,14 +23,20 @@ export const CANSignalsExportProvider = ({ children }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getDynamicColumnCANSignals = async (vin, timestart, timeend, cansingals, token) => {
|
||||
const getDynamicColumnCANSignals = async (vin, timestart, timeend, cansignals, selectall, token) => {
|
||||
try {
|
||||
setBusy(true)
|
||||
if (!vin) return;
|
||||
|
||||
validateVIN(vin);
|
||||
if (timestart > timeend) throw new Error("Start time cannot be after end time");
|
||||
const result = await api.getCanSignalsVin(vin, timestart, timeend, cansingals, token);
|
||||
|
||||
let result
|
||||
if (selectall === true) {
|
||||
result = await api.getCanSignalsVin(vin, timestart, timeend, [], selectall, token);
|
||||
} else {
|
||||
result = await api.getCanSignalsVin(vin, timestart, timeend, cansignals, false, token);
|
||||
}
|
||||
if (result.error || !result.ok)
|
||||
throw new Error(`Get CAN signals error. ${result.message}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user