More quick updates and clean up
This commit is contained in:
@@ -5,12 +5,22 @@ import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
|
||||
export async function load({ params, url }) { // route
|
||||
export async function load({ params, parent, url }) { // route
|
||||
// console.log(`Svelte Event Speakers layout.ts data = params:`, params);
|
||||
// console.log(`Svelte Event Speakers layout.ts data = route:`, route);
|
||||
// console.log(`Svelte Event Speakers layout.ts data = url:`, url);
|
||||
|
||||
let data = await parent();
|
||||
console.log(`Svelte Events Speakers layout.ts data = data:`, data);
|
||||
|
||||
data.ae_events_speakers_layout_ts = true;
|
||||
|
||||
|
||||
let event_id = url.searchParams.get('event_id');
|
||||
if (!event_id) {
|
||||
// event_id = $ae_loc.site_cfg_json.slct__event_id;
|
||||
event_id = data.ae_loc.site_cfg_json.slct__event_id;
|
||||
}
|
||||
|
||||
await handle_load_ae_obj_id__event({event_id: event_id, try_cache: false})
|
||||
.then(function (event_obj_results) {
|
||||
@@ -38,17 +48,97 @@ export async function load({ params, url }) { // route
|
||||
return event_obj_results;
|
||||
})
|
||||
|
||||
let data_struct = {
|
||||
params: params,
|
||||
sections: [
|
||||
{ slug: 'new', title: 'New Speaker' },
|
||||
{ slug: 'manage', title: 'Manage' },
|
||||
{ slug: 'test', title: 'Test' },
|
||||
],
|
||||
url: url,
|
||||
|
||||
};
|
||||
return data_struct;
|
||||
let ds_code_li = {}; //: key_val; // = ae_loc_tmp.ds;
|
||||
// console.log(`ae_ ds_code_li = `, ds_code_li);
|
||||
let ds_code: string = '';
|
||||
let ds_type: null|string = null;
|
||||
|
||||
ds_code = 'hub__page__events_speakers__create_info_header';
|
||||
ds_type = 'text';
|
||||
|
||||
ds_code_li[ds_code] = await api.get_data_store_obj_w_code({
|
||||
api_cfg: get(ae_api),
|
||||
data_store_code: ds_code,
|
||||
data_type: ds_type,
|
||||
log_lvl: 2
|
||||
})
|
||||
.then( function (ds_results) {
|
||||
console.log(`ae_ Data Store ${ds_code} = `, ds_results);
|
||||
if (ds_results) {
|
||||
console.log(`ae_ Data Store ${ds_code} = `, ds_results);
|
||||
if (ds_type == 'json') {
|
||||
return ds_results.json;
|
||||
} else {
|
||||
return ds_results.text;
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(function (ds_code_val) {
|
||||
console.log(`ae_ ds_code_val = `, ds_code_val);
|
||||
|
||||
return ds_code_val;
|
||||
});
|
||||
|
||||
ds_code = 'hub__page__events_speakers__create_info';
|
||||
ds_type = 'text';
|
||||
|
||||
ds_code_li[ds_code] = await api.get_data_store_obj_w_code({
|
||||
api_cfg: get(ae_api),
|
||||
data_store_code: ds_code,
|
||||
data_type: ds_type,
|
||||
log_lvl: 2
|
||||
})
|
||||
.then( function (ds_results) {
|
||||
console.log(`ae_ Data Store ${ds_code} = `, ds_results);
|
||||
if (ds_results) {
|
||||
console.log(`ae_ Data Store ${ds_code} = `, ds_results);
|
||||
if (ds_type == 'json') {
|
||||
return ds_results.json;
|
||||
} else {
|
||||
return ds_results.text;
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(function (ds_code_val) {
|
||||
console.log(`ae_ ds_code_val = `, ds_code_val);
|
||||
|
||||
return ds_code_val;
|
||||
});
|
||||
|
||||
|
||||
let ae_loc_tmp = get(ae_loc);
|
||||
console.log(`ae_loc = `, ae_loc_tmp);
|
||||
|
||||
let ae_ds_tmp = ae_loc_tmp.ds;
|
||||
// Merge the new data into the existing data
|
||||
ae_ds_tmp = {
|
||||
...ae_ds_tmp,
|
||||
...ds_code_li,
|
||||
}
|
||||
|
||||
ae_loc_tmp = {
|
||||
...ae_loc_tmp,
|
||||
'ds': ae_ds_tmp,
|
||||
}
|
||||
console.log(`ae_loc = `, ae_loc_tmp);
|
||||
ae_loc.set(ae_loc_tmp);
|
||||
|
||||
// return data_struct;
|
||||
return data;
|
||||
|
||||
|
||||
// let data_struct = {
|
||||
// params: params,
|
||||
// sections: [
|
||||
// { slug: 'new', title: 'New Speaker' },
|
||||
// { slug: 'manage', title: 'Manage' },
|
||||
// { slug: 'test', title: 'Test' },
|
||||
// ],
|
||||
// url: url,
|
||||
|
||||
// };
|
||||
// return data_struct;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user