Work on post and comment email notifications.

This commit is contained in:
Scott Idem
2024-11-22 13:13:44 -05:00
parent 6a79cb165d
commit 1868adad99
5 changed files with 151 additions and 31 deletions

View File

@@ -41,7 +41,8 @@ export async function load_ae_obj_id__post_comment(
// This is expecting a list
db_save_ae_obj_li__post_comment({
obj_type: 'post_comment',
obj_li: [post_comment_obj_get_result]
obj_li: [post_comment_obj_get_result],
log_lvl: log_lvl
});
}
@@ -121,7 +122,9 @@ export async function load_ae_obj_li__post_comment(
if (post_comment_obj_li_get_result) {
if (try_cache) {
db_save_ae_obj_li__post_comment({
obj_type: 'post_comment', obj_li: post_comment_obj_li_get_result
obj_type: 'post_comment',
obj_li: post_comment_obj_li_get_result,
log_lvl: log_lvl
});
}
return post_comment_obj_li_get_result;
@@ -181,7 +184,8 @@ export async function create_ae_obj__post_comment(
db_save_ae_obj_li__post_comment(
{
obj_type: 'post_comment',
obj_li: [post_comment_obj_create_result]
obj_li: [post_comment_obj_create_result],
log_lvl: log_lvl
});
}
return post_comment_obj_create_result;
@@ -288,7 +292,8 @@ export async function update_ae_obj__post_comment(
if (post_comment_obj_update_result) {
if (try_cache) {
db_save_ae_obj_li__post_comment({
obj_type: 'post_comment', obj_li: [post_comment_obj_update_result]
obj_type: 'post_comment', obj_li: [post_comment_obj_update_result],
log_lvl: log_lvl
});
}
return post_comment_obj_update_result;
@@ -315,7 +320,7 @@ export function db_save_ae_obj_li__post_comment(
{
obj_type,
obj_li,
log_lvl=0
log_lvl = 0
}: {
obj_type: string,
obj_li: any,
@@ -365,14 +370,14 @@ export function db_save_ae_obj_li__post_comment(
// From SQL view
});
// console.log(`Put obj with ID: ${obj.post_comment_id_random} or ${id_random}`);
if (log_lvl) {
console.log(`Put obj with ID: ${obj.post_comment_id_random} or ${id_random}`);
}
} catch (error) {
let status = `Failed to put ${obj.post_comment_id_random}: ${error}`;
console.log(status);
return false;
}
// const id_random = await db_posts.comment.put(obj);
// console.log(`Put obj with ID: ${obj.post_comment_id_random}`);
});
return true;