Progress on more low level updates to the Events module loading process.
This commit is contained in:
@@ -2,49 +2,49 @@
|
||||
console.log(`ae_events_pres_mgmt +layout.ts start`);
|
||||
|
||||
// Imports
|
||||
import { browser } from '$app/environment';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
// import { browser } from '$app/environment';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
|
||||
export async function load({ parent }) {
|
||||
let log_lvl: number = 0;
|
||||
|
||||
let data = await parent();
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
|
||||
let parent_data = await parent();
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts parent_data:`, parent_data);
|
||||
|
||||
let account_id = data.account_id;
|
||||
let account_id = parent_data.account_id;
|
||||
if (!account_id) {
|
||||
console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the data!!!`);
|
||||
console.log(`events_pres_mgmt +layout.ts: The account_id was not found in the parent_data!!!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let ae_acct = data[account_id];
|
||||
let ae_acct = parent_data[account_id];
|
||||
if (log_lvl) {
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
}
|
||||
|
||||
let event_id = ae_acct.slct.event_id; // From root +layout.ts
|
||||
// let event_id = ae_acct.slct.event_id; // From root +layout.ts
|
||||
// if (!event_id) {
|
||||
// console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the data!!!`);
|
||||
// console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the parent_data!!!`);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (browser) {
|
||||
if (log_lvl) {
|
||||
console.log(`ae_events_pres_mgmt +layout.ts data:`, data);
|
||||
}
|
||||
// if (browser) {
|
||||
// if (log_lvl) {
|
||||
// console.log(`ae_events_pres_mgmt +layout.ts parent_data:`, parent_data);
|
||||
// }
|
||||
|
||||
// Should we limit these to event.conference = true?
|
||||
let load_event_obj_li = events_func.load_ae_obj_li__event({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
params: {qry__enabled: 'enabled', qry__limit: 25},
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
}
|
||||
// // Should we limit these to event.conference = true?
|
||||
// let load_event_obj_li = events_func.load_ae_obj_li__event({
|
||||
// api_cfg: ae_acct.api,
|
||||
// for_obj_type: 'account',
|
||||
// for_obj_id: account_id,
|
||||
// params: {qry__enabled: 'enabled', qry__limit: 25},
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// ae_acct.slct.event_obj_li = load_event_obj_li;
|
||||
// }
|
||||
|
||||
// let load_event_obj = events_func.load_ae_obj_id__event({
|
||||
// api_cfg: ae_acct.api,
|
||||
@@ -60,12 +60,12 @@ export async function load({ parent }) {
|
||||
// // manage: {name: 'Manage', href: '/events_pres_mgmt/manage', access: 'administrator', disable: true, hide: true},
|
||||
// locations: {name: 'Locations', href: `/events/${event_id}/locations`, access: false, disable: false, hide: false},
|
||||
// };
|
||||
// data.submenu = submenu
|
||||
// parent_data.submenu = submenu
|
||||
|
||||
// WARNING: Precaution against shared data between sites and sessions.
|
||||
data[account_id] = ae_acct;
|
||||
// WARNING: Precaution against shared parent_data between sites and sessions.
|
||||
parent_data[account_id] = ae_acct;
|
||||
|
||||
return data;
|
||||
return parent_data;
|
||||
}
|
||||
|
||||
// export const prerender = false;
|
||||
|
||||
Reference in New Issue
Block a user