Move checkFetchStatus into NodelHelper

This commit is contained in:
rejas
2021-04-24 09:14:08 +02:00
committed by veeck
parent 90aa50bb11
commit b212641069
5 changed files with 13 additions and 17 deletions

View File

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

View File

@@ -113,6 +113,15 @@ const NodeHelper = Class.extend({
}
});
NodeHelper.checkFetchStatus = function (response) {
// response.status >= 200 && response.status < 300
if (response.ok) {
return response;
} else {
throw Error(response.statusText);
}
};
NodeHelper.create = function (moduleDefinition) {
return NodeHelper.extend(moduleDefinition);
};