Update types
This commit is contained in:
+2
-19
@@ -2,31 +2,16 @@
|
||||
|
||||
const runQuery = require("./utils/runQuery");
|
||||
|
||||
/**
|
||||
* @typedef {Object} LocalPostReturn
|
||||
* @property {boolean} success - Did the function run successfully?
|
||||
* @property {*} [payload] - GET request results
|
||||
* @property {string} [msg] - Message
|
||||
* @property {string} [error] - Error Message
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} LocalPostQueryObject
|
||||
* @property {string | import("../../utils/post").PostDataPayload} query - Table Name
|
||||
* @property {string} [tableName] - Table Name
|
||||
* @property {string[]} [queryValues] - GET request results
|
||||
*/
|
||||
|
||||
/**
|
||||
* Make a get request to Datasquirel API
|
||||
* ==============================================================================
|
||||
* @async
|
||||
*
|
||||
* @param {Object} params - Single object passed
|
||||
* @param {LocalPostQueryObject} params.options - SQL Query
|
||||
* @param {import("../../package-shared/types").LocalPostQueryObject} params.options - SQL Query
|
||||
* @param {import("../../package-shared/types").DSQL_DatabaseSchemaType | undefined} [params.dbSchema] - Name of the table to query
|
||||
*
|
||||
* @returns { Promise<LocalPostReturn> } - Return Object
|
||||
* @returns { Promise<import("../../package-shared/types").LocalPostReturn> } - Return Object
|
||||
*/
|
||||
async function localPost({ options, dbSchema }) {
|
||||
try {
|
||||
@@ -83,7 +68,6 @@ async function localPost({ options, dbSchema }) {
|
||||
|
||||
return {
|
||||
success: false,
|
||||
payload: null,
|
||||
error: error.message,
|
||||
};
|
||||
}
|
||||
@@ -95,7 +79,6 @@ async function localPost({ options, dbSchema }) {
|
||||
|
||||
return {
|
||||
success: false,
|
||||
payload: null,
|
||||
msg: "Something went wrong!",
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user