Update Types and Bugfixes
This commit is contained in:
parent
30f607ce8d
commit
bf1d7f5fcd
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datasquirel",
|
||||
"version": "2.1.7",
|
||||
"version": "2.2.0",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
@ -8,6 +8,7 @@ function serializeQuery({ query }) {
|
||||
/** @type {string[]} */
|
||||
const queryArr = [];
|
||||
keys.forEach((key) => {
|
||||
if (!key || !query[key]) return;
|
||||
queryArr.push(`${key}=${query[key]}`);
|
||||
});
|
||||
str += queryArr.join("&");
|
||||
|
15
utils/get.js
15
utils/get.js
@ -101,23 +101,8 @@ async function get({ key, db, query, queryValues, tableName }) {
|
||||
|
||||
const queryString = serializeQuery({ query: queryObject });
|
||||
|
||||
// let path = `/api/query/get?db=${db}&query=${query
|
||||
// .replace(/\n|\r|\n\r/g, "")
|
||||
// .replace(/ {2,}/g, " ")
|
||||
// .replace(/ /g, "+")}`;
|
||||
|
||||
console.log("queryString =>", queryString);
|
||||
|
||||
let path = `/api/query/get${queryString}`;
|
||||
|
||||
if (queryValues) {
|
||||
path += `&queryValues=${JSON.stringify(queryValues)}`;
|
||||
}
|
||||
|
||||
if (tableName) {
|
||||
path += `&tableName=${tableName}`;
|
||||
}
|
||||
|
||||
/** @type {https.RequestOptions} */
|
||||
const requestObject = {
|
||||
method: "GET",
|
||||
|
Loading…
Reference in New Issue
Block a user