Updates
This commit is contained in:
Vendored
+2
@@ -52,12 +52,14 @@ function fetchApi(url, options) {
|
||||
let fetchData;
|
||||
let fetchOptions = {};
|
||||
try {
|
||||
fetchOptions.method = options.method;
|
||||
if (options.method.match(/post|put|delete|patch/i)) {
|
||||
if (options.body && typeof options.body == "object") {
|
||||
fetchOptions.body = JSON.stringify(options.body);
|
||||
}
|
||||
}
|
||||
fetchOptions.headers = lodash_1.default.merge(finalHeaders, options.headers || {});
|
||||
fetchOptions = lodash_1.default.merge(fetchOptions, options.fetchOptions);
|
||||
fetchData = yield fetch(url, fetchOptions);
|
||||
data = fetchData.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user