General work through out the day. Lots of interruptions from the dogs.
This commit is contained in:
39
src/routes/events_leads/+layout.ts
Normal file
39
src/routes/events_leads/+layout.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/** @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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user