Forgot to save my work earlier...?

This commit is contained in:
Scott Idem
2025-01-15 22:05:41 -05:00
parent 6f11820857
commit 8b309d7b04
4 changed files with 100 additions and 127 deletions

View File

@@ -29,7 +29,7 @@ export async function load({ parent }) {
}
// The await at this point seems to be important. If it is in the sponsor function then the data is not available to the layout. - 2024-04-01
let load_sponsorship_cfg_obj = await spons_func.handle_load_ae_obj_id__sponsorship_cfg({
let load_sponsorship_cfg_obj = await spons_func.load_ae_obj_id__sponsorship_cfg({
api_cfg: ae_acct.api,
sponsorship_cfg_id: sponsorship_cfg_id,
try_cache: false,

View File

@@ -243,93 +243,6 @@ async function handle_load_ae_obj_li__sponsorship({account_id, try_cache=true})
}
// Load the Sponsorship Cfg Obj with ID based on the URL param.
// if (data.url.searchParams.get('sponsorship_cfg_id')) {
// $slct.sponsorship_cfg_id = data.url.searchParams.get('sponsorship_cfg_id');
// $slct_trigger = 'load__sponsorship_cfg_obj';
// } else {
// $slct.sponsorship_cfg_id = $ae_loc.mod.sponsorships.cfg_id;
// }
// $slct_trigger = 'load__sponsorship_cfg_obj';
// $: if ($slct_trigger == 'load__sponsorship_cfg_obj' && $slct.sponsorship_cfg_id) {
// console.log('Selected Sponsorship Cfg ID:', $slct.sponsorship_cfg_id);
// $slct_trigger = null;
// $ae_loc.mod.sponsorships.cfg_id = $slct.sponsorship_cfg_id;
// handle_load_ae_obj_id__sponsorship_cfg({sponsorship_cfg_id: $slct.sponsorship_cfg_id, try_cache: false});
// }
// async function handle_load_ae_obj_id__sponsorship_cfg({sponsorship_cfg_id, try_cache=false}) {
// console.log(`*** handle_load_ae_obj_id__sponsorship_cfg() *** sponsorship_cfg_id=${sponsorship_cfg_id}`);
// let params = {};
// // $ae_loc.mod.sponsorships.qry_status = 'loading';
// ae_sponsorship_cfg_obj_get_promise = api.get_ae_obj_id_crud({
// api_cfg: $ae_api,
// obj_type: 'sponsorship_cfg',
// obj_id: sponsorship_cfg_id,
// use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
// use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
// params: params,
// log_lvl: 1
// })
// .then(function (sponsorship_cfg_obj_get_result) {
// if (sponsorship_cfg_obj_get_result) {
// $slct.sponsorship_cfg_obj = sponsorship_cfg_obj_get_result;
// console.log(`sponsorship_cfg object:`, $slct.sponsorship_cfg_obj);
// }
// // Auto show the selected sponsorship ID
// // Is this pushState needed here?
// // Set the URL param "sponsorship_cfg_id" to the current sponsorship ID.
// // const url = new URL(location);
// // url.searchParams.set('sponsorship_cfg_id', $slct.sponsorship_cfg_id);
// // history.pushState({}, '', url);
// // Is this postMessage needed here?
// // let message = {'sponsorship_cfg_id': $slct.sponsorship_cfg_id};
// // window.parent.postMessage(message, "*");
// // modalStore.trigger(modal_view__sponsorship_cfg_obj);
// })
// .catch(function (error) {
// console.log('No results returned or failed.', error);
// })
// .finally(function () {
// // For CHOW 2024 only
// $ae_loc.mod.sponsorships.level_guest_max_li = {
// 0: 0,
// 1: 4, // CHOW 2024 - Friend
// 2: 8, // CHOW 2024 - Supporter
// 3: 8, // CHOW 2024 - Advocate
// 4: 8, // CHOW 2024 - Champion
// 5: 8, // CHOW 2024 - Presenting Partner
// 6: 16, // CHOW 2024 - Signature Partner
// 7: 16, // CHOW 2024 - Premier Partner
// };
// // $ae_loc.mod.sponsorships.level_guest_max_li = {
// // '0': 0,
// // '1': 4,
// // '2': 8,
// // '3': 8,
// // '4': 8,
// // '5': 16, // This is a guess for CHOW 2024!!!
// // '6': 16, // This is a guess for CHOW 2024!!!
// // };
// // if ($slct.sponsorship_cfg_obj.info_about_levels) {
// // $slct.sponsorship_cfg_obj.info_about_levels = JSON.parse($slct.sponsorship_cfg_obj.info_about_levels);
// // }
// // $ae_loc.hub.sponsorship_cfg_id_qry_status = 'done';
// });
// return ae_sponsorship_cfg_obj_get_promise;
// }
// Load the Sponsorship Obj with ID based on the URL param.
$: if ($slct_trigger == 'load__sponsorship_obj' && $slct.sponsorship_id) {
console.log('Selected Sponsorship ID:', $slct.sponsorship_id);