Updates
This commit is contained in:
+10
-2
@@ -24,7 +24,7 @@ const deleteDbEntry_1 = __importDefault(require("../../functions/backend/db/dele
|
||||
function dsqlCrud(params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var _a;
|
||||
const { action, data, table, targetValue, sanitize, targetField, targetId, dbFullName, deleteData, batchData, deleteKeyValues, debug, tableSchema, deleteKeyValuesOperator, dbConfig, query, onDuplicate, } = params;
|
||||
const { action, data, table, targetValue, sanitize, targetField, targetId, targetIds, dbFullName, deleteData, batchData, deleteKeyValues, debug, tableSchema, deleteKeyValuesOperator, dbConfig, query, onDuplicate, } = params;
|
||||
const finalData = (sanitize ? sanitize({ data }) : data);
|
||||
const finalBatchData = (sanitize ? sanitize({ batchData }) : batchData);
|
||||
const queryObject = query
|
||||
@@ -74,7 +74,15 @@ function dsqlCrud(params) {
|
||||
return UPDATE_RESULT;
|
||||
case "delete":
|
||||
let res;
|
||||
if (whereClauseObject) {
|
||||
if (targetIds) {
|
||||
const DELETE_RES = yield (0, deleteDbEntry_1.default)({
|
||||
tableName: table,
|
||||
dbFullName,
|
||||
targetIds,
|
||||
});
|
||||
return DELETE_RES;
|
||||
}
|
||||
else if (whereClauseObject) {
|
||||
const DELETE_RES = yield (0, deleteDbEntry_1.default)({
|
||||
whereClauseObject,
|
||||
tableName: table,
|
||||
|
||||
Reference in New Issue
Block a user