CEC-4241 - Add trouble code to DTC search (#356)
This commit is contained in:
@@ -9,15 +9,15 @@ export const DTCTimelineProvider = ({ children }) => {
|
||||
const [dtcData, setDTCData] = useState([]);
|
||||
const [total, setTotal] = useState(0)
|
||||
|
||||
const getDTCData = async (vin, ecu, startDate, endDate, search,token) => {
|
||||
const getDTCData = async (vin, ecu, troubleCode, startDate, endDate, search, token) => {
|
||||
try {
|
||||
setBusy(true);
|
||||
const result = await api.getDTCData(vin, ecu, startDate, endDate, search,token);
|
||||
const result = await api.getDTCData(vin, ecu, troubleCode, startDate, endDate, search, token);
|
||||
if (result.error) {
|
||||
throw new Error(`Get DTC data error. ${result.message}`);
|
||||
}
|
||||
setDTCData(result.data ?? []);
|
||||
if (result.total){
|
||||
if (result.total) {
|
||||
setTotal(result.total)
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user