mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Add fetcher_helper for calendar and newsfeed
This commit is contained in:
12
js/fetcher_helper.js
Normal file
12
js/fetcher_helper.js
Normal 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;
|
Reference in New Issue
Block a user