Bugfix
This commit is contained in:
+10
-2
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = dsqlCrud;
|
||||
const get_1 = __importDefault(require("../../actions/get"));
|
||||
const post_1 = __importDefault(require("../../actions/post"));
|
||||
const sql_generator_1 = __importDefault(require("../../functions/dsql/sql/sql-generator"));
|
||||
const conn_db_handler_1 = __importDefault(require("../db/conn-db-handler"));
|
||||
function dsqlCrud(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ action, data, table, targetId, query, sanitize, debug, }) {
|
||||
const finalData = sanitize ? sanitize(data) : data;
|
||||
@@ -27,7 +27,12 @@ function dsqlCrud(_a) {
|
||||
tableName: table,
|
||||
genObject: query,
|
||||
});
|
||||
const GET_RES = yield (0, conn_db_handler_1.default)(global.DSQL_DB_CONN, (queryObject === null || queryObject === void 0 ? void 0 : queryObject.string) || "", (queryObject === null || queryObject === void 0 ? void 0 : queryObject.values) || []);
|
||||
const GET_RES = yield (0, get_1.default)({
|
||||
query: (queryObject === null || queryObject === void 0 ? void 0 : queryObject.string) || "",
|
||||
queryValues: (queryObject === null || queryObject === void 0 ? void 0 : queryObject.values) || [],
|
||||
debug,
|
||||
forceLocal: true,
|
||||
});
|
||||
return Object.assign(Object.assign({}, GET_RES), { queryObject });
|
||||
case "insert":
|
||||
return yield (0, post_1.default)({
|
||||
@@ -36,6 +41,7 @@ function dsqlCrud(_a) {
|
||||
table,
|
||||
data: finalData,
|
||||
},
|
||||
forceLocal: true,
|
||||
});
|
||||
case "update":
|
||||
data === null || data === void 0 ? true : delete data.id;
|
||||
@@ -47,6 +53,7 @@ function dsqlCrud(_a) {
|
||||
identifierValue: String(finalId),
|
||||
data: finalData,
|
||||
},
|
||||
forceLocal: true,
|
||||
});
|
||||
case "delete":
|
||||
return yield (0, post_1.default)({
|
||||
@@ -56,6 +63,7 @@ function dsqlCrud(_a) {
|
||||
identifierColumnName: "id",
|
||||
identifierValue: String(finalId),
|
||||
},
|
||||
forceLocal: true,
|
||||
});
|
||||
default:
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user