Files
OSIT-AE-App-Svelte/src/routes/events/+page.ts
Scott Idem 519f5b949c chore: move ae_events_functions.ts into ae_events/ module
Relocates the functions file from lib root into its module directory,
matching the pattern used by all other modules (ae_journals, ae_archives, etc.).
Updated all 85 import paths from \$lib/ae_events_functions → \$lib/ae_events/ae_events_functions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 09:52:13 -04:00

52 lines
1.4 KiB
TypeScript

/** @type {import('./$types').PageLoad} */
import { browser } from '$app/environment';
import { events_func } from '$lib/ae_events/ae_events_functions';
export async function load({ parent }) {
const log_lvl: number = 0;
const parent_data = await parent();
const account_id = parent_data.account_id;
const ae_acct = parent_data[account_id];
// const event_id = ae_acct.slct.event_id; // From root +layout.ts
// if (!event_id) {
// if (log_lvl) {
// console.log(`INFO: events +layout.ts: The event_id was not found in the parent_data.`);
// }
// }
if (browser) {
if (log_lvl) console.log(`ae_events +page.ts (Non-Blocking Refresh)`);
// if (event_id) {
// // Refresh the specific selected event
// events_func.load_ae_obj_id__event({
// api_cfg: ae_acct.api,
// event_id: event_id,
// log_lvl: log_lvl
// });
// }
// Refresh the list of events for the account
events_func.load_ae_obj_li__event({
api_cfg: ae_acct.api,
for_obj_type: 'account',
for_obj_id: account_id,
// inc_session_li: false,
hidden: 'all', // 'not_hidden'
enabled: 'enabled',
limit: 25,
try_cache: true,
log_lvl: log_lvl
});
}
parent_data[account_id] = ae_acct;
return parent_data;
}