Minor categories refactor

This commit is contained in:
Tzahi12345
2023-06-06 01:23:06 -04:00
parent 78d48f2ab9
commit 3615b810e4
2 changed files with 3 additions and 5 deletions

View File

@@ -32,10 +32,8 @@ async function categorize(file_jsons) {
return null;
}
for (let i = 0; i < file_jsons.length; i++) {
const file_json = file_jsons[i];
for (let j = 0; j < categories.length; j++) {
const category = categories[j];
for (const file_json of file_jsons) {
for (const category of categories) {
const rules = category['rules'];
// if rules for current category apply, then that is the selected category

View File

@@ -842,7 +842,7 @@ describe('Categories', async function() {
rules: [],
custom_output: ''
};
await db_api.removeAllRecords('categories', {name: 'test_category'});
await db_api.insertRecordIntoTable('categories', new_category);
});