More updates related to replacing the forEach loop with the for loop. Async... await...

This commit is contained in:
Scott Idem
2025-05-09 14:32:45 -04:00
parent dc7da8c930
commit 5ef6d7dc0c
4 changed files with 242 additions and 180 deletions

View File

@@ -544,10 +544,11 @@ export async function db_save_ae_obj_li__journal(
if (obj_li && obj_li.length) {
let obj_li_id: string[] = [];
for (const obj of obj_li) {
// obj_li.forEach(async function (obj: any) {
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
console.log(`Processing ae_obj ${obj_type}:`, obj);
}
let description = obj.description ?? '';
@@ -662,5 +663,10 @@ export async function db_save_ae_obj_li__journal(
}
return obj_li_id;
} else {
if (log_lvl) {
console.log('No objects to save.');
}
return [];
}
}

View File

@@ -397,10 +397,11 @@ export async function db_save_ae_obj_li__journal_entry(
if (obj_li && obj_li.length) {
// let obj_li_id = obj_li.map((obj: any) => obj.journal_entry_id_random);
let obj_li_id: string[] = [];
for (const obj of obj_li) {
// obj_li.forEach(async function (obj: any) {
if (log_lvl) {
console.log(`ae_obj ${obj_type}:`, obj);
console.log(`Processing ae_obj ${obj_type}:`, obj);
}
let content = obj.content ?? '';
@@ -577,5 +578,10 @@ export async function db_save_ae_obj_li__journal_entry(
}
return obj_li_id;
} else {
if (log_lvl) {
console.log('No objects to save.');
}
return [];
}
}