Add fetcher_helper for calendar and newsfeed

This commit is contained in:
rejas
2021-03-28 14:17:03 +02:00
committed by veeck
parent a6879e853b
commit 90aa50bb11
7 changed files with 31 additions and 21 deletions

12
js/fetcher_helper.js Normal file
View File

@@ -0,0 +1,12 @@
const FetcherHelper = {
checkStatus: function (response) {
// response.status >= 200 && response.status < 300
if (response.ok) {
return response;
} else {
throw Error(response.statusText);
}
}
};
module.exports = FetcherHelper;