This commit is contained in:
2026-01-05 13:49:54 +01:00
parent 8bcb35a8f0
commit 58984214fc
7 changed files with 20 additions and 9 deletions
+4 -3
View File
@@ -16,7 +16,7 @@ exports.default = checks;
const lodash_1 = __importDefault(require("lodash"));
function checks(_a) {
return __awaiter(this, arguments, void 0, function* ({ table, allowedTables, query, body, method, getMiddleware, postMiddleware, putMiddleware, deleteMiddleware, crudMiddleware, targetId, }) {
var _b, _c, _d, _e;
var _b, _c, _d, _e, _f;
const allowedTable = allowedTables.find((tbl) => tbl.table == table);
if (!allowedTable) {
throw new Error(`Can't Access this table: \`${table}\``);
@@ -51,8 +51,9 @@ function checks(_a) {
}
}
if ((_e = newQuery === null || newQuery === void 0 ? void 0 : newQuery.searchQuery) === null || _e === void 0 ? void 0 : _e.join) {
for (let i = 0; i < newQuery.searchQuery.join.length; i++) {
const join = newQuery.searchQuery.join[i];
const alljoins = (_f = newQuery === null || newQuery === void 0 ? void 0 : newQuery.searchQuery) === null || _f === void 0 ? void 0 : _f.join.flat();
for (let i = 0; i < alljoins.length; i++) {
const join = alljoins[i];
if (!join)
continue;
const joinTableName = join.tableName;