I guess this is better than it was...
This commit is contained in:
@@ -3,37 +3,40 @@ 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!!!`);
|
||||
let account_id = data.account_id;
|
||||
let ae_acct = data[account_id];
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
|
||||
if (!account_id) {
|
||||
console.log(`events_leads +layout.ts: The account_id was not found in the data!!!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let event_id = null;
|
||||
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 event_id was not found in the data.ae_loc.site_cfg_json!!!`);
|
||||
let event_id = ae_acct.slct.event_id;
|
||||
if (!event_id) {
|
||||
console.log(`events_leads +layout.ts: The event_id was not found in the data!!!`);
|
||||
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});
|
||||
let load_event_obj = events_func.handle_load_ae_obj_id__event({api_cfg: ae_acct.api, event_id: event_id, try_cache: false});
|
||||
|
||||
data.ae_slct.event_id = event_id;
|
||||
data.ae_slct.event_obj = await load_event_obj;
|
||||
ae_acct.slct.event_obj = 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});
|
||||
let load_event_exhibit_obj_li = events_func.handle_load_ae_obj_li__exhibit({api_cfg: ae_acct.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;
|
||||
|
||||
ae_acct.slct.event_exhibit_obj_li = load_event_exhibit_obj_li;
|
||||
|
||||
// WARNING: Precaution against shared data between sites and sessions.
|
||||
data[account_id] = ae_acct;
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
// export const prerender = true;
|
||||
// export const prerender = false;
|
||||
// export const prerender = true;
|
||||
|
||||
Reference in New Issue
Block a user