39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
/** @type {import('./$types').LayoutLoad} */
|
|
console.log(`ae_events_leads +layout.ts start`);
|
|
|
|
import { events_func } from '$lib/ae_events_functions';
|
|
|
|
export async function load({ parent }) {
|
|
|
|
let data = await parent();
|
|
|
|
if (data.ae_loc.account_id) {
|
|
} else {
|
|
console.log(`The account_id was not found in the data.ae_loc!!!`);
|
|
return false;
|
|
}
|
|
|
|
let event_id = null;
|
|
if (data.url.searchParams.get('event_id')) {
|
|
event_id = data.url.searchParams.get('event_id');
|
|
} else if (data.ae_loc.site_cfg_json.slct__event_id) {
|
|
event_id = data.ae_loc.site_cfg_json.slct__event_id;
|
|
} else if (data.ae_loc.default__event_id) {
|
|
event_id = data.ae_loc.default__event_id;
|
|
} else {
|
|
console.log(`The slct__event_id was not found in the data.ae_loc.site_cfg_json!!!`);
|
|
return false;
|
|
}
|
|
|
|
let load_event_obj = events_func.handle_load_ae_obj_id__event({api_cfg: data.ae_api, event_id: event_id, try_cache: false});
|
|
|
|
data.ae_slct.event_id = event_id;
|
|
data.ae_slct.event_obj = await load_event_obj;
|
|
|
|
let load_event_exhibit_obj_li = events_func.handle_load_ae_obj_li__exhibit({api_cfg: data.ae_api, event_id: event_id, try_cache: false});
|
|
console.log(`load_event_exhibit_obj_li = `, load_event_exhibit_obj_li);
|
|
data.ae_slct.event_exhibit_obj_li = load_event_exhibit_obj_li;
|
|
|
|
return data;
|
|
|
|
} |