Trying to make things work better...
This commit is contained in:
49
src/lib/ae_sponsorships_functions.ts
Normal file
49
src/lib/ae_sponsorships_functions.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
// import { liveQuery } from "dexie";
|
||||
// import { db_core } from "$lib/db_core";
|
||||
|
||||
// let example_li = liveQuery(
|
||||
// () => db_core.sponsorships.toArray()
|
||||
// );
|
||||
|
||||
let ae_promises: key_val = {}; // Promise<any>;
|
||||
|
||||
// Updated 2024-03-20
|
||||
async function handle_load_ae_obj_id__sponsorship_cfg({ api_cfg, sponsorship_cfg_id, try_cache=false }) {
|
||||
console.log(`*** handle_load_ae_obj_id__sponsorship_cfg() *** sponsorship_cfg_id=${sponsorship_cfg_id}`);
|
||||
|
||||
let params = {};
|
||||
|
||||
// ae_loc.hub.sponsorships.qry_status = 'loading';
|
||||
ae_promises.load__sponsorship_cfg_obj = await api.get_ae_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'sponsorship_cfg',
|
||||
obj_id: sponsorship_cfg_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: 2
|
||||
})
|
||||
.then(function (sponsorship_cfg_obj_get_result) {
|
||||
if (sponsorship_cfg_obj_get_result) {
|
||||
return sponsorship_cfg_obj_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return ae_promises.load__sponsorship_cfg_obj;
|
||||
}
|
||||
|
||||
|
||||
|
||||
let export_obj = {
|
||||
handle_load_ae_obj_id__sponsorship_cfg: handle_load_ae_obj_id__sponsorship_cfg,
|
||||
};
|
||||
export let spons_func = export_obj;
|
||||
Reference in New Issue
Block a user