Saving changes to the Journals and API CRUD V3 fixes.

This commit is contained in:
Scott Idem
2026-01-02 19:30:33 -05:00
parent 33d42ed85b
commit 6eb601f56d
6 changed files with 123 additions and 107 deletions

View File

@@ -157,6 +157,7 @@ export async function load_ae_obj_li__journal_entry({
// Process the results first
const processed_obj_li = await process_ae_obj__journal_entry_props({
obj_li: journal_entry_obj_li_get_result,
journal_id: for_obj_type === 'journal' ? for_obj_id : undefined,
log_lvl: log_lvl
});
if (log_lvl) {
@@ -240,6 +241,7 @@ export async function create_ae_obj__journal_entry({
// Process the results first
const processed_obj_li = await process_ae_obj__journal_entry_props({
obj_li: [journal_entry_obj_create_result],
journal_id,
log_lvl: log_lvl
});
if (log_lvl) {
@@ -950,9 +952,11 @@ async function _process_generic_props<T extends Record<string, any>>({
// Updated 2025-05-09
export async function process_ae_obj__journal_entry_props({
obj_li,
journal_id,
log_lvl = 0
}: {
obj_li: any[];
journal_id?: string;
log_lvl?: number;
}) {
return _process_generic_props({
@@ -960,6 +964,12 @@ export async function process_ae_obj__journal_entry_props({
obj_type: 'journal_entry',
log_lvl,
specific_processor: async (obj) => {
// Inject journal_id if provided and missing
if (journal_id) {
if (!obj.journal_id) obj.journal_id = journal_id;
if (!obj.journal_id_random) obj.journal_id_random = journal_id;
}
// Content processing
let content = obj.content ?? '';
let content_cleaned: null | string = null;