diff --git a/src/lib/ae_archives/ae_archives__archive.ts b/src/lib/ae_archives/ae_archives__archive.ts index 0605e642..3f13b3e7 100644 --- a/src/lib/ae_archives/ae_archives__archive.ts +++ b/src/lib/ae_archives/ae_archives__archive.ts @@ -173,7 +173,7 @@ export async function load_ae_obj_li__archive( api_cfg: api_cfg, for_obj_type: 'archive', for_obj_id: archive_id, - params: {qry__enabled: enabled, qry__limit: limit}, + params: params, try_cache: try_cache, log_lvl: log_lvl }) diff --git a/src/lib/ae_posts/ae_posts__post.ts b/src/lib/ae_posts/ae_posts__post.ts index d6aeaed9..0f11a072 100644 --- a/src/lib/ae_posts/ae_posts__post.ts +++ b/src/lib/ae_posts/ae_posts__post.ts @@ -173,7 +173,7 @@ export async function load_ae_obj_li__post( api_cfg: api_cfg, for_obj_type: 'post', for_obj_id: post_id, - params: {qry__enabled: enabled, qry__limit: limit}, + params: params, try_cache: try_cache, log_lvl: log_lvl }) diff --git a/src/routes/idaa/(idaa)/bb/+layout.ts b/src/routes/idaa/(idaa)/bb/+layout.ts index 2003640c..4973d078 100644 --- a/src/routes/idaa/(idaa)/bb/+layout.ts +++ b/src/routes/idaa/(idaa)/bb/+layout.ts @@ -31,7 +31,7 @@ export async function load({ params, parent }) { // route for_obj_id: account_id, inc_comment_li: true, order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'title': 'ASC'}, - params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, + params: {qry__enabled: 'enabled', qry__hidden: 'not_hidden', qry__limit: 200}, try_cache: true, log_lvl: log_lvl }); 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 74143cbd..86c747a0 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 @@ -14,7 +14,7 @@ import Tiptap_editor from '$lib/element_tiptap_editor.svelte'; export let lq__post_comment_obj: any; -let prom_api__post_comment_obj_v2: any; +let prom_api__post_comment_obj: any; let disable_submit_btn = false; @@ -92,7 +92,7 @@ async function handle_submit_form(event: any) { console.log(post_comment_do); if (!$idaa_slct.post_comment_id) { - prom_api__post_comment_obj_v2 = posts_func.create_ae_obj__post_comment({ + prom_api__post_comment_obj = posts_func.create_ae_obj__post_comment({ api_cfg: $ae_api, post_id: $idaa_slct.post_id, data_kv: post_comment_do, @@ -119,9 +119,9 @@ async function handle_submit_form(event: any) { $idaa_sess.bb.show__inline_edit__post_comment_id = false; }); - return prom_api__post_comment_obj_v2; + return prom_api__post_comment_obj; } else { - prom_api__post_comment_obj_v2 = posts_func.update_ae_obj__post_comment({ + prom_api__post_comment_obj = posts_func.update_ae_obj__post_comment({ api_cfg: $ae_api, post_comment_id: $idaa_slct.post_comment_id, data_kv: post_comment_do, @@ -147,16 +147,44 @@ async function handle_submit_form(event: any) { $idaa_sess.bb.show__inline_edit__post_comment_id = false; }); - return prom_api__post_comment_obj_v2; + return prom_api__post_comment_obj; } } -async function handle_delete_post_comment_obj({post_comment_id, method}: key_val) { - console.log('*** handle_delete_post_comment_obj() ***'); +// Updated 2024-11-15 +async function handle_delete_post_comment_obj( + { + post_comment_id, + method = 'disable' + }: { + post_comment_id: string, + method?: string + } + ) { + if (log_lvl) { + console.log('*** handle_delete_post_comment_obj() ***'); + } + prom_api__post_comment_obj = posts_func.delete_ae_obj_id__post_comment({ + api_cfg: $ae_api, + post_comment_id: post_comment_id, + method: method, + log_lvl: log_lvl + }) + .then(function (post_comment_obj_delete_result) { + $idaa_sess.bb.show__inline_edit__post_comment_id = false; + }) + .catch(function (error) { + console.log('The result was null or false when trying to delete.', error); + }) + .finally(() => { + // $idaa_sess.recovery_meetings.show__modal_edit = false; + $idaa_slct.post_comment_id = null; + $idaa_slct.post_comment_obj = null; + }); - return true; + return prom_api__post_comment_obj; } @@ -170,10 +198,10 @@ async function handle_delete_post_comment_obj({post_comment_id, method}: key_val