Making the loading a bit more efficient and cleaner

This commit is contained in:
Scott Idem
2024-02-22 20:28:29 -05:00
parent d1328eb67c
commit 02f693c13e
4 changed files with 215 additions and 7 deletions

View File

@@ -494,6 +494,7 @@ export let post_object = async function post_object({api_cfg=null, endpoint='',
// Updated 2023-12-01
export let get_ae_obj_id_crud = async function get_ae_obj_id_crud({
api_cfg,
no_account_id=false,
obj_type,
obj_id,
use_alt_table=false,
@@ -576,6 +577,8 @@ export let get_ae_obj_id_crud = async function get_ae_obj_id_crud({
endpoint = `/crud/post/comment/${obj_id}`;
} else if (obj_type == 'site') {
endpoint = `/crud/site/${obj_id}`;
} else if (obj_type == 'site_domain') {
endpoint = `/crud/site/domain/${obj_id}`;
} else if (obj_type == 'sponsorship_cfg') {
endpoint = `/crud/sponsorship/cfg/${obj_id}`;
} else if (obj_type == 'sponsorship') {
@@ -597,6 +600,10 @@ export let get_ae_obj_id_crud = async function get_ae_obj_id_crud({
console.log('Params:', params);
}
if (no_account_id) {
headers['x_no_account_id_token'] = 'Nothing to See Here'; // get_object() will fix the underscores to dashes
}
let object_obj_get_promise = await get_object({
api_cfg: api_cfg,
endpoint: endpoint,