Work on post and comment email notifications.
This commit is contained in:
@@ -703,14 +703,14 @@ export function db_save_ae_obj_li__post(
|
||||
// post_comment_kv: obj.post_comment_kv,
|
||||
// post_comment_li: obj.post_comment_li,
|
||||
});
|
||||
// console.log(`Put obj with ID: ${obj.post_id_random} or ${id_random}`);
|
||||
if (log_lvl) {
|
||||
console.log(`Put obj with ID: ${obj.post_id_random} or ${id_random}`);
|
||||
}
|
||||
} catch (error) {
|
||||
let status = `Failed to put ${obj.post_id_random}: ${error}`;
|
||||
console.log(status);
|
||||
return false;
|
||||
}
|
||||
|
||||
// const id_random = await db_posts.post.put(obj);
|
||||
// console.log(`Put obj with ID: ${obj.post_id_random}`);
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user