minor revision

This commit is contained in:
Tben 2023-07-27 10:53:18 +01:00
parent 1e13f49c91
commit 603fe4bf17
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "datasquirel", "name": "datasquirel",
"version": "1.1.92", "version": "1.1.93",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -41,10 +41,11 @@ const https = require("https");
* @param {string} params.key - FULL ACCESS API Key * @param {string} params.key - FULL ACCESS API Key
* @param {string} params.database - Database Name * @param {string} params.database - Database Name
* @param {PostDataPayload | string} params.query - SQL query String or Request Object * @param {PostDataPayload | string} params.query - SQL query String or Request Object
* @param {any[]} [params.queryValues] - Query Values if using "?" placeholders
* *
* @returns { Promise<PostReturn> } - Return Object * @returns { Promise<PostReturn> } - Return Object
*/ */
async function post({ key, query, database }) { async function post({ key, query, queryValues, database }) {
/** /**
* Make https request * Make https request
* *
@ -53,6 +54,7 @@ async function post({ key, query, database }) {
const httpResponse = await new Promise((resolve, reject) => { const httpResponse = await new Promise((resolve, reject) => {
const reqPayloadString = JSON.stringify({ const reqPayloadString = JSON.stringify({
query, query,
queryValues,
database, database,
}).replace(/\n|\r|\n\r/gm, ""); }).replace(/\n|\r|\n\r/gm, "");