More updates related to replacing the forEach loop with the for loop. Async... await...
This commit is contained in:
@@ -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 [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user