feat: refs #6555 iron out url parms builder
gitea/worker-time-control/pipeline/pr-test This commit looks good
Details
gitea/worker-time-control/pipeline/pr-test This commit looks good
Details
This commit is contained in:
parent
ab326dd6ac
commit
76411063ba
|
@ -77,9 +77,8 @@ async function call(url, { method = "GET", body = {}, params = {} }) {
|
|||
|
||||
if (method === "GET") {
|
||||
const searchParams = new URLSearchParams();
|
||||
for (let key in params) {
|
||||
if (params.hasOwnProperty(key) && typeof params[key] === "object") searchParams.append(key, JSON.stringify(params[key]));
|
||||
else searchParams.append(key, params[key]);
|
||||
for (let [key, value] of Object.entries(params)) {
|
||||
searchParams.append(key, typeof value === "object" ? JSON.stringify(value) : value);
|
||||
}
|
||||
|
||||
url += "?" + searchParams.toString();
|
||||
|
|
Loading…
Reference in New Issue