Forgot to save my work earlier...?

This commit is contained in:
Scott Idem
2025-01-15 22:05:41 -05:00
parent 6f11820857
commit 8b309d7b04
4 changed files with 100 additions and 127 deletions

View File

@@ -14,7 +14,7 @@ let ae_promises: key_val = {}; // Promise<any>;
// Updated 2024-03-29
async function handle_load_ae_obj_id__sponsorship_cfg(
async function load_ae_obj_id__sponsorship_cfg(
{
api_cfg,
sponsorship_cfg_id,
@@ -28,7 +28,7 @@ async function handle_load_ae_obj_id__sponsorship_cfg(
}
) {
if (log_lvl) {
console.log(`*** handle_load_ae_obj_id__sponsorship_cfg() *** sponsorship_cfg_id=${sponsorship_cfg_id}`);
console.log(`*** load_ae_obj_id__sponsorship_cfg() *** sponsorship_cfg_id=${sponsorship_cfg_id}`);
}
let params = {};
@@ -51,9 +51,9 @@ async function handle_load_ae_obj_id__sponsorship_cfg(
}
if (try_cache) {
// This is expecting a list
db_save_ae_obj_li__sponsorship({
obj_type: 'sponsorship',
obj_li: [sponsorship_obj_get_result]
db_save_ae_obj_li__sponsorship_cfg({
obj_type: 'sponsorship_cfg',
obj_li: [sponsorship_cfg_obj_get_result]
});
}
return sponsorship_cfg_obj_get_result;
@@ -74,6 +74,66 @@ async function handle_load_ae_obj_id__sponsorship_cfg(
}
// Updated 2024-03-29
async function load_ae_obj_id__sponsorship(
{
api_cfg,
sponsorship_id,
try_cache = false,
log_lvl = 0
}: {
api_cfg: any,
sponsorship_id: string,
try_cache: boolean,
log_lvl: number
}
) {
if (log_lvl) {
console.log(`*** load_ae_obj_id__sponsorship() *** sponsorship_id=${sponsorship_id}`);
}
let params = {};
ae_promises.load__sponsorship_obj = api.get_ae_obj_id_crud({
api_cfg: api_cfg,
obj_type: 'sponsorship',
obj_id: sponsorship_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 in the API config.
params: params,
log_lvl: log_lvl
})
.then(function (sponsorship_obj_get_result) {
if (sponsorship_obj_get_result) {
if (log_lvl) {
console.log(`*spons_func* Got a result for sponsorship_id ${sponsorship_id}`);
} else if (log_lvl > 1) {
console.log(`*spons_func* Got a result for sponsorship_id ${sponsorship_id}:`, sponsorship_obj_get_result);
}
if (try_cache) {
// This is expecting a list
db_save_ae_obj_li__sponsorship({
obj_type: 'sponsorship',
obj_li: [sponsorship_obj_get_result]
});
}
return sponsorship_obj_get_result;
} else {
console.log('No results returned.');
return null;
}
})
.catch(function (error) {
console.log('No results returned or failed.', error);
});
if (log_lvl) {
console.log('ae_promises.load__sponsorship_obj:', ae_promises.load__sponsorship_obj);
}
return ae_promises.load__sponsorship_obj;
}
// Updated 2025-01-15
async function load_ae_obj_li__sponsorship(
{
@@ -285,7 +345,8 @@ export function db_save_ae_obj_li__sponsorship(
let export_obj = {
handle_load_ae_obj_id__sponsorship_cfg: handle_load_ae_obj_id__sponsorship_cfg,
load_ae_obj_id__sponsorship_cfg: load_ae_obj_id__sponsorship_cfg,
load_ae_obj_id__sponsorship: load_ae_obj_id__sponsorship,
load_ae_obj_li__sponsorship: load_ae_obj_li__sponsorship,
handle_download_export__sponsorship: handle_download_export__sponsorship,
db_save_ae_obj_li__sponsorship: db_save_ae_obj_li__sponsorship