CEC-5904: Added DTC timeline export feature (#517)
This commit is contained in:
@@ -28,6 +28,27 @@ const DTCTimelineAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler);
|
||||
},
|
||||
|
||||
exportDTCData: async (vin, ecu, troubleCode, startDate, endDate, search, token) => {
|
||||
const queryParams = {
|
||||
ecu,
|
||||
trouble_code: troubleCode,
|
||||
start_time: startDate,
|
||||
end_time: endDate,
|
||||
decode: true,
|
||||
...search,
|
||||
};
|
||||
const url = addQueryParams(`${API_ENDPOINT}/dtc_snapshot_export/${vin}`, queryParams);
|
||||
return fetch(url, {
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
responseType: "blob"
|
||||
})
|
||||
.catch(errorHandler);
|
||||
},
|
||||
};
|
||||
|
||||
export default DTCTimelineAPI;
|
||||
Reference in New Issue
Block a user