Bug fixes and general code clean up related to the IDAA Archives.

This commit is contained in:
Scott Idem
2025-09-03 14:35:44 -04:00
parent acb96729d1
commit 711e24a7d0
6 changed files with 52 additions and 100 deletions

View File

@@ -15,6 +15,10 @@ export async function load_ae_obj_id__archive(
api_cfg,
archive_id,
inc_content_li = false,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 99,
offset = 0,
params = {},
try_cache = true,
log_lvl = 0
@@ -22,6 +26,10 @@ export async function load_ae_obj_id__archive(
api_cfg: any,
archive_id: string,
inc_content_li?: boolean,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
@@ -95,8 +103,10 @@ export async function load_ae_obj_id__archive(
api_cfg: api_cfg,
for_obj_type: 'archive',
for_obj_id: archive_id,
enabled: 'all',
limit: 99,
enabled: enabled, // all, disabled, enabled
hidden: hidden, // all, hidden, not_hidden
limit: limit, // Limit for the comments
offset: offset,
params: params,
try_cache: try_cache,
log_lvl: log_lvl
@@ -156,39 +166,6 @@ export async function load_ae_obj_li__archive(
// console.log('params_json:', params_json);
// ae_promises.load__archive_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
// api_cfg: api_cfg,
// obj_type: 'archive',
// for_obj_type: for_obj_type,
// for_obj_id: for_obj_id,
// use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
// use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
// enabled: enabled,
// hidden: hidden,
// order_by_li: order_by_li,
// limit: limit,
// offset: offset,
// params_json: params_json,
// params: params,
// log_lvl: log_lvl
// })
// .then(function (archive_obj_li_get_result) {
// if (archive_obj_li_get_result) {
// if (try_cache) {
// db_save_ae_obj_li__archive({
// obj_type: 'archive',
// obj_li: archive_obj_li_get_result
// });
// }
// return archive_obj_li_get_result;
// } else {
// return [];
// }
// })
// .catch(function (error) {
// console.log('No results returned or failed.', error);
// });
ae_promises.load__archive_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
api_cfg: api_cfg,
obj_type: 'archive',
@@ -260,6 +237,10 @@ export async function load_ae_obj_li__archive(
api_cfg: api_cfg,
for_obj_type: 'archive',
for_obj_id: archive_id,
enabled: enabled, // all, disabled, enabled
hidden: hidden, // all, hidden, not_hidden
limit: limit, // Limit for the comments
offset: offset,
params: params,
try_cache: try_cache,
log_lvl: log_lvl

View File

@@ -15,11 +15,21 @@ export async function load_ae_obj_id__archive_content(
{
api_cfg,
archive_content_id,
// enabled = 'enabled',
// hidden = 'not_hidden',
// limit = 99,
// offset = 0,
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
archive_content_id: string,
// enabled?: string,
// hidden?: string,
// limit?: number,
// offset?: number,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
@@ -28,14 +38,12 @@ export async function load_ae_obj_id__archive_content(
console.log(`*** load_ae_obj_id__archive_content() *** archive_content_id=${archive_content_id}`);
}
let params = {};
ae_promises.load__archive_content_obj = await api.get_ae_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'archive_content',
obj_id: archive_content_id, // NOTE: This is the FQDN, not normally the ID.
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
obj_id: archive_content_id,
use_alt_table: false,
use_alt_base: false,
params: params,
log_lvl: log_lvl
})
@@ -118,11 +126,6 @@ export async function load_ae_obj_li__archive_content(
console.log(`*** load_ae_obj_li__archive_content() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
}
// let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
// let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
// let limit: number = (params.qry__limit ?? 99); // 99
// let offset: number = (params.qry__offset ?? 0); // 0
let params_json: key_val = {};
// console('params_json:', params_json);