Initial work on finally creating and implementing more generic and standardized CRUD functions for my Aether objects. It should work very well for Delete, Create, and Update. Load and Load List will need more work.

This commit is contained in:
Scott Idem
2025-08-01 17:30:30 -04:00
parent 9ed4bd85e1
commit 0a4940161d
6 changed files with 722 additions and 47 deletions

View File

@@ -4,6 +4,8 @@ console.log(`ae_p_journals [journal_entry_id] +page.ts start`);
import { browser } from '$app/environment';
import { journals_func } from '$lib/ae_journals/ae_journals_functions';
import { db_journals, journal_entry_field_li } from "$lib/ae_journals/db_journals";
import { load_ae_obj_id } from '$lib/ae_core/core__crud_generic';
export async function load({ params, parent }) { // route
let log_lvl: number = 0;
@@ -34,11 +36,20 @@ export async function load({ params, parent }) { // route
console.log(`ae_journals journals [journal_entry_id] +page.ts: journal_entry_id = `, journal_entry_id);
}
// Load event journal entry object
let load_journal_entry_obj = journals_func.load_ae_obj_id__journal_entry({
// let load_journal_entry_obj = journals_func.load_ae_obj_id__journal_entry({
// api_cfg: ae_acct.api,
// journal_entry_id: journal_entry_id,
// try_cache: true,
// log_lvl: log_lvl
// });
let load_journal_entry_obj = load_ae_obj_id({
api_cfg: ae_acct.api,
journal_entry_id: journal_entry_id,
try_cache: true,
log_lvl: log_lvl
obj_type: 'journal_entry',
obj_id: journal_entry_id,
db_instance: db_journals,
db_field_li: journal_entry_field_li,
log_lvl: 2
});
if (!load_journal_entry_obj) {