Updates
This commit is contained in:
@@ -48,6 +48,8 @@ export default async function fetchApi<
|
||||
let fetchOptions: RequestInit = {};
|
||||
|
||||
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);
|
||||
@@ -56,6 +58,8 @@ export default async function fetchApi<
|
||||
|
||||
fetchOptions.headers = _.merge(finalHeaders, options.headers || {});
|
||||
|
||||
fetchOptions = _.merge(fetchOptions, options.fetchOptions);
|
||||
|
||||
fetchData = await fetch(url, fetchOptions);
|
||||
data = fetchData.json();
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user