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; return null;
} }
for (let i = 0; i < file_jsons.length; i++) { for (const file_json of file_jsons) {
const file_json = file_jsons[i]; for (const category of categories) {
for (let j = 0; j < categories.length; j++) {
const category = categories[j];
const rules = category['rules']; const rules = category['rules'];
// if rules for current category apply, then that is the selected category // if rules for current category apply, then that is the selected category

View File

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