This commit is contained in:
Benjamin Toby
2025-02-12 12:12:11 +01:00
parent ca65327527
commit e089f84ef4
13 changed files with 34 additions and 73 deletions
+1 -1
View File
@@ -4,6 +4,6 @@ export default function dsqlCrud<T extends {
[key: string]: any;
} = {
[key: string]: any;
}>({ action, data, table, targetId, query, sanitize, }: DsqlCrudParam<T>): Promise<(PostReturn & {
}>({ action, data, table, targetId, query, sanitize, debug, }: DsqlCrudParam<T>): Promise<(PostReturn & {
queryObject?: ReturnType<Awaited<typeof sqlGenerator>>;
}) | null>;
+2 -1
View File
@@ -17,7 +17,7 @@ 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"));
function dsqlCrud(_a) {
return __awaiter(this, arguments, void 0, function* ({ action, data, table, targetId, query, sanitize, }) {
return __awaiter(this, arguments, void 0, function* ({ action, data, table, targetId, query, sanitize, debug, }) {
const finalData = sanitize ? sanitize(data) : data;
const finalId = targetId;
let queryObject;
@@ -30,6 +30,7 @@ function dsqlCrud(_a) {
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,
});
return Object.assign(Object.assign({}, GET_RES), { queryObject });
case "insert":