diff --git a/src/routes/events_badges/review/+page.svelte b/src/routes/events_badges/review/+page.svelte
index 5b335021..d95bb15a 100644
--- a/src/routes/events_badges/review/+page.svelte
+++ b/src/routes/events_badges/review/+page.svelte
@@ -230,15 +230,16 @@ $: if ($events_trigger == 'load__event_badge_obj_li' && $events_slct.event_id) {
$events_trigger = null;
load_obj_li_results = handle_load_ae_obj_li__badge({event_id: $events_slct.event_id, try_cache: false})
- .then(function (load_obj_li_results) {
- if (load_obj_li_results) {
- console.log(`load_obj_li_results=`, load_obj_li_results);
+ .then(function (load_results) {
+ if (load_results) {
+ console.log(`load_results=`, load_results);
} else {
console.log('No results returned.');
}
- // return load_obj_li_results;
- console.log(`load_obj_li_results=`, load_obj_li_results);
- $events_slct.badge_obj_li = load_obj_li_results;
+ // return load_results;
+ console.log(`load_results=`, load_results);
+ $events_slct.badge_obj_li = load_results;
+ return load_results;
});
}
@@ -341,12 +342,12 @@ async function handle_load_ae_obj_li__badge({event_id, try_cache=true}) {
{#await load_obj_li_results}
-
+
Loading...
-
+
{:then load_obj_li_results}
{#if load_obj_li_results}
diff --git a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte
index 894a4557..b0d0c2ce 100644
--- a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte
+++ b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte
@@ -40,6 +40,13 @@ import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
import type { key_val } from '$lib/ae_stores';
+if ($slct.sponsorship_id) {
+ console.log(`Sponsorship ID selected: ${$slct.sponsorship_id}`);
+ console.log(`Sponsorship object selected:`, $slct.sponsorship_obj);
+
+ $slct_trigger = 'load__sponsorship_obj';
+}
+
onMount(() => {
console.log('** Component Mounted: ** View Modal - Sponsorship Obj');
@@ -254,7 +261,9 @@ async function handle_submit_form(event) {
temp_address.mailing['country'] = sponsorship_di.address_country;
}
- sponsorship_do['address_li_json'] = temp_address;
+ if (temp_address.mailing && Object.keys(temp_address.mailing).length) {
+ sponsorship_do['address_li_json'] = temp_address;
+ }
if (sponsorship_di.poc_full_name || sponsorship_di.poc_email) {
sponsorship_do['poc_json'] = {
@@ -464,6 +473,7 @@ async function handle_submit_form(event) {
$ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false;
$ae_sess.mod.sponsorships.submit_status = 'created';
+ $slct_trigger = 'load__sponsorship_obj';
} else {
ae_promises.update__sponsorship_obj = await handle_update__sponsorship({
obj_type: 'sponsorship',
@@ -472,18 +482,38 @@ async function handle_submit_form(event) {
});
$ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false;
$ae_sess.mod.sponsorships.submit_status = 'updated';
+
+ $slct_trigger = 'load__sponsorship_obj';
}
- if ($store_current_tab == 'start') {
- $store_current_tab = 'marketing';
- } else if ($store_current_tab == 'marketing') {
- $store_current_tab = 'exhibit';
- } else if ($store_current_tab == 'exhibit') {
- $store_current_tab = 'sessions';
- } else if ($store_current_tab == 'sessions') {
- $store_current_tab = 'files';
- } else if ($store_current_tab == 'files') {
- $store_current_tab = 'guests';
+ if ($slct.sponsorship_id) {
+ console.log(`Moving on to next section for ID: ${$slct.sponsorship_id}`);
+
+ if ($store_current_tab == 'start' && $slct.sponsorship_id) {
+ $store_current_tab = 'marketing';
+
+ // If level is above 1 then they can go to the exhibits tab.
+ } else if ($store_current_tab == 'marketing' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num > 1) {
+ $store_current_tab = 'exhibit';
+
+ } else if ($store_current_tab == 'marketing' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num == 1) {
+ $store_current_tab = 'files';
+
+ // If level is above 2 then they can go to the sessions tab.
+ } else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num > 2) {
+ $store_current_tab = 'sessions';
+
+ } else if ($store_current_tab == 'exhibit' && $slct.sponsorship_id && $slct.sponsorship_obj.level_num <= 2) {
+ $store_current_tab = 'files';
+
+ } else if ($store_current_tab == 'sessions') {
+ $store_current_tab = 'files';
+
+ } else if ($store_current_tab == 'files') {
+ $store_current_tab = 'guests';
+ }
+ } else {
+ console.log('No obj ID found!');
}
}
@@ -568,7 +598,7 @@ async function handle_submit_form_files(event) {
}
// Promo video file (30 seconds or less)
- if (event.target.file_media_promo_video.files.length > 0) {
+ if (typeof event.target.file_media_promo_video !== 'undefined' && event.target.file_media_promo_video.files.length > 0) {
console.log('The promo video file was found.');
hosted_file_results = await handle_input_upload_files(event.target.file_media_promo_video.files);
@@ -594,6 +624,10 @@ async function handle_submit_form_files(event) {
});
$ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false;
$ae_sess.mod.sponsorships.submit_status = 'updated';
+
+ if ($store_current_tab == 'files') {
+ $store_current_tab = 'guests';
+ }
}
@@ -672,12 +706,15 @@ async function handle_update__sponsorship({
obj_id: obj_id,
fields: data,
key: $ae_api.api_crud_super_key,
+ return_obj: true,
log_lvl: 2
})
.then(async function (update__obj_result) {
if (!update__obj_result) {
console.log('The result was null or false.');
return false;
+ } else {
+ console.log(`update__obj_result = `, update__obj_result);
}
return update__obj_result;
})
@@ -789,7 +826,12 @@ async function handle_update__sponsorship({
General Info
-
+
{#if $slct.sponsorship_obj.website_url && $slct.sponsorship_obj.website_url.length > 10}
@@ -800,7 +842,9 @@ async function handle_update__sponsorship({
{#if $slct.sponsorship_obj.level_num > 1}
-
+
{#if $slct.sponsorship_obj.questions_li_json && $slct.sponsorship_obj.questions_li_json.table_exhibit}
@@ -811,7 +855,7 @@ async function handle_update__sponsorship({
{/if}
{#if $slct.sponsorship_obj.level_num > 2}
-
+
{#if $slct.sponsorship_obj.questions_li_json && ($slct.sponsorship_obj.questions_li_json.virtual_session || $slct.sponsorship_obj.questions_li_json.virtual_session === 0)}
@@ -821,7 +865,9 @@ async function handle_update__sponsorship({
Session Info
{/if}
-
+
{#if $slct.sponsorship_obj.logo_li_json && $slct.sponsorship_obj.logo_li_json.primary && $slct.sponsorship_obj.logo_li_json.primary.hosted_file_id_random}
@@ -830,7 +876,9 @@ async function handle_update__sponsorship({
File Uploads
-
+
{#if $slct.sponsorship_obj.guest_li_json && $slct.sponsorship_obj.guest_li_json.length > 0}
@@ -995,7 +1043,7 @@ async function handle_update__sponsorship({