chore: bump version to 0.0.37 and update adapter to set search parameters from body
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/query",
|
"name": "@kevisual/query",
|
||||||
"version": "0.0.36",
|
"version": "0.0.37",
|
||||||
"main": "dist/query-browser.js",
|
"main": "dist/query-browser.js",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ export const adapter = async (opts: AdapterOpts = {}, overloadOpts?: RequestInit
|
|||||||
// 浏览器环境下,自动将 body 中的 path 和 key 提取到查询参数中, 更容易排查问题
|
// 浏览器环境下,自动将 body 中的 path 和 key 提取到查询参数中, 更容易排查问题
|
||||||
let body = opts.body as Record<string, any> || {};
|
let body = opts.body as Record<string, any> || {};
|
||||||
if (!params.path && body?.path) {
|
if (!params.path && body?.path) {
|
||||||
params.path = body.path;
|
searchParams.set('path', body.path);
|
||||||
if (body?.key) {
|
if (body?.key) {
|
||||||
params.key = body.key;
|
searchParams.set('key', body.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user