From 4aeded3a129441f2e530e3995f915111f3600ce1 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 1 Oct 2025 13:03:16 -0400 Subject: [PATCH] Working on making sure notifications are being sent to IDAA staff when a post or post comment is created or updated. It looks like it is working.... --- .../bb/ae_idaa_comp__post_comment_obj_id_edit.svelte | 7 +++++-- .../(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) 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 381bb16b..d8c8645e 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 @@ -159,12 +159,14 @@ async function handle_submit_form(event: any) { $idaa_sess.bb.show__inline_edit__post_comment_id = false; // Send notification to staff - if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_new_email) { + // if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_new_email) { + if ($ae_loc.site_cfg_json?.bb_send_staff_new_email) { send_staff_notification_email(); } // Send notification to the original poster if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_poster_email && $idaa_slct.post_obj.notify) { + // if ($ae_loc.site_cfg_json?.bb_send_poster_email && $idaa_slct.post_obj.notify) { send_poster_notification_email(); } @@ -217,7 +219,8 @@ async function handle_submit_form(event: any) { disable_submit_btn = false; $idaa_sess.bb.show__inline_edit__post_comment_id = false; - if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_update_email) { + // if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_update_email) { + if ($ae_loc.site_cfg_json?.bb_send_staff_update_email) { send_staff_notification_email(); } diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte index c656211d..bfa9582b 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte @@ -154,9 +154,10 @@ async function handle_submit_form(event: any) { // post_do['notes'] = event_meeting_fd.notes; } - console.log(post_do); - log_lvl = 1; + if (log_lvl) { + console.log(post_do); + } if (!$idaa_slct.post_id) { prom_api__post_obj = posts_func.create_ae_obj__post({ @@ -188,7 +189,8 @@ async function handle_submit_form(event: any) { disable_submit_btn = false; $idaa_sess.bb.edit__post_obj = false; - if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_new_email) { + // if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_new_email) { + if ($ae_loc.site_cfg_json?.bb_send_staff_new_email) { send_staff_notification_email(); } }); @@ -224,7 +226,8 @@ async function handle_submit_form(event: any) { disable_submit_btn = false; $idaa_sess.bb.edit__post_obj = false; - if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_update_email) { + // if (!$ae_loc.administrator_access && $ae_loc.site_cfg_json?.bb_send_staff_update_email) { + if ($ae_loc.site_cfg_json?.bb_send_staff_update_email) { send_staff_notification_email(); } });