f
This commit is contained in:
@@ -61,12 +61,12 @@ export const adapter = async (opts: AdapterOpts = {}, overloadOpts?: RequestInit
|
|||||||
url = new URL(opts.url);
|
url = new URL(opts.url);
|
||||||
} else {
|
} else {
|
||||||
origin = window?.location?.origin || 'http://localhost:51515';
|
origin = window?.location?.origin || 'http://localhost:51515';
|
||||||
url = new URL(opts.url, origin);
|
url = new URL(opts?.url || '', origin);
|
||||||
}
|
}
|
||||||
const isGet = method === 'GET';
|
const isGet = method === 'GET';
|
||||||
const oldSearchParams = url.searchParams;
|
const oldSearchParams = url.searchParams;
|
||||||
if (isGet) {
|
if (isGet) {
|
||||||
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts.body } as SimpleObject);
|
let searchParams = new URLSearchParams({ ...Object.fromEntries(oldSearchParams), ...opts?.params, ...opts?.body } as SimpleObject);
|
||||||
url.search = searchParams.toString();
|
url.search = searchParams.toString();
|
||||||
} else {
|
} else {
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user