CEC-1691 Handle 503 errors (#156)

This commit is contained in:
John Wu
2022-05-18 16:02:13 -07:00
committed by GitHub
parent 8fde694801
commit 23111f9c3a
8 changed files with 206 additions and 104 deletions

View File

@@ -1,4 +1,5 @@
import {
errorHandler,
getAuthHeaderOptions,
fetchRespHandler,
addQueryParams,
@@ -15,7 +16,9 @@ const updatesAPI = {
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
}).then(fetchRespHandler),
})
.then(fetchRespHandler)
.catch(errorHandler),
getCarUpdateLog: async (query, token) => {
const u = addQueryParams(`${API_ENDPOINT}/carupdateslog`, query);
@@ -25,7 +28,9 @@ const updatesAPI = {
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler);
})
.then(fetchRespHandler)
.catch(errorHandler);
},
getCarUpdateProgress: async (carupdateids, token) => {
@@ -36,7 +41,9 @@ const updatesAPI = {
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler);
})
.then(fetchRespHandler)
.catch(errorHandler);
},
getCarUpdates: async (search, token) => {
@@ -47,7 +54,9 @@ const updatesAPI = {
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler);
})
.then(fetchRespHandler)
.catch(errorHandler);
},
getVINUpdates: async (vin, token) => {
@@ -58,7 +67,9 @@ const updatesAPI = {
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler);
})
.then(fetchRespHandler)
.catch(errorHandler);
},
};