diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte index 127ce6ac..f8967260 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte @@ -315,6 +315,7 @@ }) .then(function (post_obj_update_result) { // $idaa_slct.post_obj = $lq__post_obj; + $idaa_slct.post_obj.linked_li_json = new_linked_li_json; }) .catch(function (error: any) { console.log('Something went wrong.'); diff --git a/src/routes/idaa/(idaa)/recovery_meetings/+layout.svelte b/src/routes/idaa/(idaa)/recovery_meetings/+layout.svelte index 06bc25dc..56f41e23 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/+layout.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/+layout.svelte @@ -3,7 +3,7 @@ let log_lvl: number = 0; // *** Import Svelte specific - import { page } from '$app/state'; + // import { page } from '$app/state'; // *** Import Aether specific variables and functions import { @@ -22,7 +22,7 @@ idaa_trig, idaa_prom } from '$lib/stores/ae_idaa_stores'; - import { events_func } from '$lib/ae_events_functions'; + // import { events_func } from '$lib/ae_events_functions'; interface Props { /** @type {import('./$types').LayoutData} */ @@ -58,58 +58,8 @@ }); } }); - // $idaa_slct.event_id = ae_acct.slct.event_id; // Not set here yet. // *** Set initial variables - - // $effect(() => { - // if ($idaa_trig.event_id && $idaa_slct.event_id) { - // log_lvl = 1; - // $idaa_trig.event_id = false; - - // if (log_lvl) { - // console.log(`Triggered: $idaa_slct.event_id = ${$idaa_slct.event_id}`); - // } - - // $idaa_prom.load__event_obj = events_func.load_ae_obj_id__event({ - // api_cfg: $ae_api, - // event_id: $idaa_slct.event_id, - // // enabled: $idaa_loc.recovery_meetings.qry__enabled, - // // hidden: $idaa_loc.recovery_meetings.qry__hidden, - // // limit: $idaa_loc.recovery_meetings.qry__limit, - // try_cache: true, - // log_lvl: log_lvl, - // }) - // .then((event_obj) => { - // if (log_lvl) { - // console.log(`Event object loaded: `, event_obj); - // } - - // $idaa_slct.event_obj = event_obj; - - // // $idaa_sess.recovery_meetings.show__modal_view = $idaa_slct.event_id; - // // $idaa_sess.recovery_meetings.show__modal_edit = false; - // }); - - // // $idaa_slct.event_obj = $idaa_prom.load__event_obj; - - // if (!page.url.searchParams.get('event_id')) { - // const url = new URL(location); - // // url.searchParams.set('event_id', $idaa_slct.event_id); - // url.searchParams.delete('event_id'); - // history.pushState({}, '', url); - - // let message = {'event_id': $idaa_slct.event_id}; - // window.parent.postMessage(message, "*"); - // } - - // // $idaa_sess.recovery_meetings.show__modal_view = $idaa_slct.event_id; - // // $idaa_sess.recovery_meetings.show__modal_view__event_id = $idaa_slct.event_id; - // // $idaa_sess.recovery_meetings.show__modal_edit = false; - // // $idaa_sess.recovery_meetings.show__modal_edit__event_id = false; - - // } - // }); {@render children?.()} diff --git a/src/routes/idaa/(idaa)/recovery_meetings/+layout.ts b/src/routes/idaa/(idaa)/recovery_meetings/+layout.ts index 3737e37f..9ca3ab4a 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/+layout.ts +++ b/src/routes/idaa/(idaa)/recovery_meetings/+layout.ts @@ -26,16 +26,6 @@ export async function load({ params, parent }) { } }; } - // console.log(`ae_acct = `, ae_acct); - - // if (!account_id) { - // console.log(`ae IDAA Recovery Meetings - [account_id] +page.ts: The account_id was not found!!!`); - // error(404, { - // message: 'Account ID not found' - // }); - // } - - // ae_acct.slct.account_id = account_id; if (browser) { const load_event_obj_li = events_func.load_ae_obj_li__event({ diff --git a/src/routes/idaa/(idaa)/recovery_meetings/+page.svelte b/src/routes/idaa/(idaa)/recovery_meetings/+page.svelte index 6fff5bfa..57c3b1fd 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/+page.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/+page.svelte @@ -9,7 +9,7 @@ let log_lvl: number = $state(1); // *** Import Svelte specific - import { page } from '$app/state'; + // import { page } from '$app/state'; import { browser } from '$app/environment'; // *** Import other supporting libraries @@ -38,7 +38,7 @@ $idaa_loc.recovery_meetings.search_version++; } - let event_id_random_li: Array = $state([]); + let event_id_li: Array = $state([]); let search_debounce_timer: any = null; let last_search_id = 0; @@ -96,7 +96,7 @@ // If 'Remote First' is toggled (Admin only), we clear results immediately to show fresh state. if (remote_first) { - event_id_random_li = []; + event_id_li = []; } // Snapshot parameters to ensure the Fast Path and Revalidation are using the same criteria. @@ -117,8 +117,7 @@ .filter((ev) => { // Resilient account check const acct_match = - ev.account_id === account_id || - ev.account_id_random === account_id; + ev.account_id === account_id; if (!acct_match) return false; if (qry_type && ev.type !== qry_type) return false; @@ -162,7 +161,7 @@ } local_ids = local_results - .map((e) => String(e.id || e.event_id_random)) + .map((e) => String(e.id)) .filter(Boolean); // Update UI immediately. This eliminates the "white page" during searching. @@ -171,7 +170,7 @@ console.log( `[Search #${current_search_id}] Fast Path complete. Found ${local_ids.length} items locally.` ); - event_id_random_li = local_ids; + event_id_li = local_ids; if (local_ids.length > 0) { $idaa_sess.recovery_meetings.qry__status = 'done'; } @@ -228,7 +227,7 @@ }); const api_ids = api_results - .map((e: any) => String(e.id || e.event_id_random)) + .map((e: any) => String(e.id)) .filter(Boolean); // UI PROTECTION: Preserve results if API returns nothing (0 results) @@ -258,7 +257,7 @@ } $idaa_slct.event_obj_li = api_results; - event_id_random_li = api_ids; + event_id_li = api_ids; // Snapshot last used filters for future protection checks $idaa_sess.recovery_meetings.status_qry__last_request_str = @@ -283,7 +282,7 @@ // If the API failed (e.g. 400/500), we should NOT preserve results from a // previous successful search as it's misleading. // We clear the list so the 'No recovery meetings found' / Error message shows. - event_id_random_li = []; + event_id_li = []; } } } @@ -312,9 +311,9 @@ show_edit_btn={true} /> -{#if Array.isArray(event_id_random_li) && event_id_random_li.length} +{#if Array.isArray(event_id_li) && event_id_li.length}