More work on getting the BB ready for IDAA. Improved notification handling. Bug fixes related to creating posts and comments.

This commit is contained in:
Scott Idem
2024-11-22 14:07:27 -05:00
parent 1868adad99
commit 7ba11a104d
6 changed files with 61 additions and 13 deletions

View File

@@ -13,12 +13,20 @@ export async function load_ae_obj_id__post(
{
api_cfg,
post_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 99,
offset = 0,
inc_comment_li = false,
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
post_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
inc_comment_li?: boolean,
try_cache?: boolean,
log_lvl?: number
@@ -45,7 +53,8 @@ export async function load_ae_obj_id__post(
// This is expecting a list
db_save_ae_obj_li__post({
obj_type: 'post',
obj_li: [post_obj_get_result]
obj_li: [post_obj_get_result],
log_lvl: log_lvl
});
}
return post_obj_get_result;
@@ -71,6 +80,10 @@ export async function load_ae_obj_id__post(
api_cfg: api_cfg,
for_obj_type: 'post',
for_obj_id: post_id,
enabled: enabled,
hidden: hidden,
limit: limit,
offset: offset,
params: {qry__enabled: 'all', qry__limit: 25},
try_cache: try_cache,
log_lvl: log_lvl
@@ -157,7 +170,8 @@ export async function load_ae_obj_li__post(
if (try_cache) {
db_save_ae_obj_li__post({
obj_type: 'post',
obj_li: post_obj_li_get_result
obj_li: post_obj_li_get_result,
log_lvl: log_lvl
});
}
return post_obj_li_get_result;
@@ -252,7 +266,8 @@ export async function create_ae_obj__post(
db_save_ae_obj_li__post(
{
obj_type: 'post',
obj_li: [post_obj_create_result]
obj_li: [post_obj_create_result],
log_lvl: log_lvl
});
}
return post_obj_create_result;
@@ -359,7 +374,9 @@ export async function update_ae_obj__post(
if (post_obj_update_result) {
if (try_cache) {
db_save_ae_obj_li__post({
obj_type: 'post', obj_li: [post_obj_update_result]
obj_type: 'post',
obj_li: [post_obj_update_result],
log_lvl: log_lvl
});
}
return post_obj_update_result;
@@ -481,7 +498,8 @@ export async function qry__post(
if (post_obj_li_get_result) {
db_save_ae_obj_li__post({
obj_type: 'post',
obj_li: post_obj_li_get_result
obj_li: post_obj_li_get_result,
log_lvl: log_lvl
});
return post_obj_li_get_result;
} else {

View File

@@ -11,11 +11,19 @@ export async function load_ae_obj_id__post_comment(
{
api_cfg,
post_comment_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 99,
offset = 0,
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
post_comment_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
try_cache?: boolean,
log_lvl?: number
}
@@ -292,7 +300,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
});
}