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