CEC-1691 Handle 503 errors (#156)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
errorHandler,
|
||||
getAuthHeaderOptions,
|
||||
fetchRespHandler,
|
||||
addQueryParams,
|
||||
@@ -14,7 +15,9 @@ const manifestsAPI = {
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
}).then(fetchRespHandler),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
getManifest: async (id, token) => {
|
||||
const u = addQueryParams(`${API_ENDPOINT}/manifest`, { id });
|
||||
@@ -24,7 +27,9 @@ const manifestsAPI = {
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
}).then(fetchRespHandler);
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler);
|
||||
},
|
||||
|
||||
getManifests: async (search, token) => {
|
||||
@@ -35,7 +40,9 @@ const manifestsAPI = {
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
}).then(fetchRespHandler);
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler);
|
||||
},
|
||||
|
||||
createManifest: async (data, token) =>
|
||||
@@ -46,7 +53,9 @@ const manifestsAPI = {
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(data),
|
||||
}).then(fetchRespHandler),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
createManifestECU: async (data, token) =>
|
||||
fetch(`${API_ENDPOINT}/manifestecu`, {
|
||||
@@ -56,7 +65,9 @@ const manifestsAPI = {
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(data),
|
||||
}).then(fetchRespHandler),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
};
|
||||
|
||||
export default manifestsAPI;
|
||||
|
||||
Reference in New Issue
Block a user