diff --git a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_edit.svelte b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_edit.svelte index 748d8483..4a9c914f 100644 --- a/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/archives/[archive_id]/ae_idaa_comp__archive_obj_id_edit.svelte @@ -180,7 +180,7 @@ async function handle_submit_form(event) { return false; } - $idaa_slct.archive_id = archive_obj_create_result.obj_id_random; + $idaa_slct.archive_id = archive_obj_create_result.archive_id_random; $idaa_slct.archive_obj = archive_obj_create_result; return update_archive_obj_promise diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte index e1bcdf3e..100d02db 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte @@ -105,7 +105,7 @@ async function handle_submit_form(event: any) { return false; } - $idaa_slct.post_comment_id = post_comment_obj_create_result.obj_id_random; + $idaa_slct.post_comment_id = post_comment_obj_create_result.post_comment_id_random; $idaa_slct.post_comment_obj = post_comment_obj_create_result; return post_comment_obj_create_result; diff --git a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit.svelte b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit.svelte index 47c931bb..5724f8cb 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit.svelte @@ -101,7 +101,7 @@ if ($ae_loc.lu_time_zone_list && $ae_loc.lu_time_zone_list.length > 0) { let lu_time_zone_li_get_promise = core_func.load_ae_obj_li__time_zone({ api_cfg: $ae_api, - log_lvl: 2 + log_lvl: 1 }) .then(function (lu_time_zone_li_get_result) { if (lu_time_zone_li_get_result) { @@ -235,6 +235,8 @@ $: if ($idaa_slct.event_obj) { async function handle_submit_form(event: any) { console.log('*** handle_submit_form() ***'); + log_lvl = 1; + disable_submit_btn = true; let form_data = new FormData(event.target); @@ -336,9 +338,14 @@ async function handle_submit_form(event: any) { // Check if the recurring_text_new_html exists and is a string if (typeof $idaa_slct.event_obj.recurring_text_new_html === 'string') { + if (log_lvl) { + console.log(`New recurring text is a string: ${$idaa_slct.event_obj.recurring_text_new_html}`); + } event_do['recurring_text'] = $idaa_slct.event_obj.recurring_text_new_html; } else { - console.log('New recurring text is not a string. Do nothing.'); + if (log_lvl) { + console.log('New recurring text is not a string. Do nothing.'); + } } console.log(event_do['recurring_text']); @@ -367,12 +374,16 @@ async function handle_submit_form(event: any) { } let current_date_iso = ae_util.iso_datetime_formatter(new Date(), 'YYYY-MM-DD'); + if (log_lvl) { + console.log(`Current date: ${current_date_iso}`); + } - // event_do['recurring_text'] = `This meeting occurs every ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_short_no_leading')} to ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_end_time']}`, 'time_short_no_leading')}.`; + // event_do['recurring_text'] = `This meeting occurs every ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_12_short_no_leading')} to ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_end_time']}`, 'time_12_short_no_leading')}.`; - // event_do['recurring_text'] = `This meeting occurs every ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_short_no_leading')}.`; + // event_do['recurring_text'] = `This meeting occurs every ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_12_short_no_leading')}.`; - event_do['recurring_text'] = `*gen* ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_short_no_leading')}`; + event_do['recurring_text'] = + `*gen* ${event_do['recurring_pattern'] ?? ''}: ${days_of_week.join(', ')} at ${ae_util.iso_datetime_formatter(`${current_date_iso} ${event_do['recurring_start_time']}`, 'time_12_short_no_leading')} ${event_do['timezone'] ?? ''}`; } event_do['external_person_id'] = event_meeting_fd.external_person_id; // NOTE: Defaults to the Novi user that created/owns this event @@ -430,7 +441,9 @@ async function handle_submit_form(event: any) { console.log('New notes is not a string. Do nothing.'); } - console.log(event_do); + if (log_lvl) { + console.log('Event object data:', event_do); + } if (!$idaa_slct.event_id) { prom_api__event_obj = events_func.create_ae_obj__event({ @@ -448,7 +461,7 @@ async function handle_submit_form(event: any) { if (log_lvl) { console.log('event_obj_create_result:', event_obj_create_result); } - $idaa_slct.event_id = event_obj_create_result.obj_id_random; + $idaa_slct.event_id = event_obj_create_result.event_id_random; $idaa_slct.event_obj = event_obj_create_result; return event_obj_create_result; @@ -464,6 +477,8 @@ async function handle_submit_form(event: any) { $idaa_sess.recovery_meetings.show__modal_view = true; }); + log_lvl = 0; + return prom_api__event_obj; } else { @@ -480,6 +495,8 @@ async function handle_submit_form(event: any) { return false; } + $idaa_slct.event_obj = event_obj_update_result; + return event_obj_update_result; }) .catch(function (error) { @@ -489,8 +506,12 @@ async function handle_submit_form(event: any) { }) .finally(() => { disable_submit_btn = false; + $idaa_sess.recovery_meetings.show__modal_edit = false; + $idaa_sess.recovery_meetings.show__modal_view = true; }); + log_lvl = 0; + return prom_api__event_obj; } @@ -541,7 +562,7 @@ async function handle_delete_event_obj( bind:clientHeight={$ae_loc.iframe_height_modal_body} > -