new(basic.gblib): New batch features.

This commit is contained in:
Rodrigo Rodriguez 2024-08-16 14:04:17 -03:00
parent c86934e646
commit faa21438fa

View file

@ -1170,11 +1170,15 @@ export class SystemKeywords {
if (!t) { if (!t) {
throw new Error(`TABLE ${file} not found. Check TABLE keywords.`); throw new Error(`TABLE ${file} not found. Check TABLE keywords.`);
} }
let res;
const systemFilter = await SystemKeywords.getFilter(args[0]); if (args[0]) {
let filter = {}; const systemFilter = await SystemKeywords.getFilter(args[0]);
filter[systemFilter.columnName] = systemFilter.value; let filter = {};
const res = await t.findAll({ where: filter }); filter[systemFilter.columnName] = systemFilter.value;
res = await t.findAll({ where: filter });
} else {
res = await t.findAll();
}
return res.length > 1 ? res : res[0]; return res.length > 1 ? res : res[0];
} }