Updates
This commit is contained in:
+7
-2
@@ -17,11 +17,16 @@ exports.default = apiGet;
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const serverError_1 = __importDefault(require("../../backend/serverError"));
|
||||
const runQuery_1 = __importDefault(require("../../backend/db/runQuery"));
|
||||
const grab_query_and_values_1 = __importDefault(require("../../../../utils/get/(utils)/grab-query-and-values"));
|
||||
/**
|
||||
* # Get Function FOr API
|
||||
*/
|
||||
function apiGet(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ query, dbFullName, queryValues, tableName, dbSchema, useLocal, debug, }) {
|
||||
const queryAndValues = (0, grab_query_and_values_1.default)({
|
||||
query,
|
||||
values: queryValues,
|
||||
});
|
||||
if (typeof query == "string" &&
|
||||
query.match(/^alter|^delete|information_schema|databases|^create/i)) {
|
||||
return { success: false, msg: "Wrong Input." };
|
||||
@@ -30,8 +35,8 @@ function apiGet(_a) {
|
||||
try {
|
||||
let { result, error } = yield (0, runQuery_1.default)({
|
||||
dbFullName: dbFullName,
|
||||
query: query,
|
||||
queryValuesArray: queryValues,
|
||||
query: queryAndValues.query,
|
||||
queryValuesArray: queryAndValues.values,
|
||||
readOnly: true,
|
||||
dbSchema,
|
||||
tableName,
|
||||
|
||||
Reference in New Issue
Block a user