diff --git a/src/lib/ae_api/api_get__crud_obj_li_v2.ts b/src/lib/ae_api/api_get__crud_obj_li_v2.ts index f4228f00..e739dab6 100644 --- a/src/lib/ae_api/api_get__crud_obj_li_v2.ts +++ b/src/lib/ae_api/api_get__crud_obj_li_v2.ts @@ -128,15 +128,15 @@ export async function get_ae_obj_li_for_obj_id_crud_v2( endpoint = `/crud/sponsorship/list`; // } else if (obj_type == 'user') { // endpoint = `/crud/user/list`; - // } else if (obj_type == 'lu' && for_obj_type == 'country_subdivision') { - // endpoint = `/crud/lu/country_subdivision/list`; - // for_obj_type = null; - // } else if (obj_type == 'lu' && for_obj_type == 'country') { - // endpoint = `/crud/lu/country/list`; - // for_obj_type = null; - // } else if (obj_type == 'lu' && for_obj_type == 'time_zone') { - // endpoint = `/crud/lu/time_zone/list`; - // for_obj_type = null; + } else if (obj_type == 'lu' && for_obj_type == 'country_subdivision') { + endpoint = `/crud/lu/country_subdivision/list`; + // for_obj_type = null; + } else if (obj_type == 'lu' && for_obj_type == 'country') { + endpoint = `/crud/lu/country/list`; + // for_obj_type = null; + } else if (obj_type == 'lu' && for_obj_type == 'time_zone') { + endpoint = `/crud/lu/time_zone/list`; + // for_obj_type = null; } else { console.log(`Unknown object type: ${obj_type}`); return false; diff --git a/src/lib/ae_core/core__countries.ts b/src/lib/ae_core/core__countries.ts index 8351608a..2d3b1e37 100644 --- a/src/lib/ae_core/core__countries.ts +++ b/src/lib/ae_core/core__countries.ts @@ -11,37 +11,42 @@ export async function load_ae_obj_li__country( { api_cfg, // account_id, + enabled = 'enabled', + hidden = 'not_hidden', + limit = 299, + offset = 0, + order_by_li = {'sort': 'DESC', 'english_short_name': 'ASC', 'alpha_2_code': 'ASC'}, params = {}, try_cache = true, log_lvl = 0 }: { api_cfg: any, // account_id: string, + enabled?: string, + hidden?: string, + limit?: number, + offset?: number, + order_by_li?: key_val params?: key_val, try_cache?: boolean, log_lvl?: number } ) { - console.log(`*** load_ae_obj_li__country() ***`); - - 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 ?? 300); // Actual is 249 in 2024 - let offset: number = (params.qry__offset ?? 0); // 0 - - let order_by_li = {'sort': 'DESC', 'english_short_name': 'ASC', 'alpha_2_code': 'ASC'}; + if (log_lvl) { + console.log(`*** load_ae_obj_li__country() ***`); + } let params_json: key_val = {}; // console.log('params_json:', params_json); - ae_promises.load__country_li = await api.get_ae_obj_li_for_obj_id_crud({ + ae_promises.load__country_li = await api.get_ae_obj_li_for_obj_id_crud_v2({ api_cfg: api_cfg, obj_type: 'lu', for_obj_type: 'country', // for_obj_id: account_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 + use_alt_tbl: false, + use_alt_mdl: false, enabled: enabled, hidden: hidden, order_by_li: order_by_li, diff --git a/src/lib/ae_core/core__country_subdivisions.ts b/src/lib/ae_core/core__country_subdivisions.ts index 86bd502d..f194d465 100644 --- a/src/lib/ae_core/core__country_subdivisions.ts +++ b/src/lib/ae_core/core__country_subdivisions.ts @@ -11,12 +11,22 @@ export async function load_ae_obj_li__country_subdivision( { api_cfg, // account_id, + enabled = 'enabled', + hidden = 'not_hidden', + limit = 399, + offset = 0, + order_by_li = {'sort': 'DESC', 'name': 'ASC', 'code': 'ASC'}, params = {}, try_cache = true, log_lvl = 0 }: { api_cfg: any, // account_id: string, + enabled?: string, + hidden?: string, + limit?: number, + offset?: number, + order_by_li?: key_val params?: key_val, try_cache?: boolean, log_lvl?: number @@ -26,24 +36,17 @@ export async function load_ae_obj_li__country_subdivision( console.log(`*** load_ae_obj_li__country_subdivision() ***`); } - 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 ?? 300); // Actual is 249 in 2024 - let offset: number = (params.qry__offset ?? 0); // 0 - - let order_by_li = {'sort': 'DESC', 'name': 'ASC', 'code': 'ASC'}; - let params_json: key_val = {}; // console.log('params_json:', params_json); - ae_promises.load__country_subdivision_li = await api.get_ae_obj_li_for_obj_id_crud({ + ae_promises.load__country_subdivision_li = await api.get_ae_obj_li_for_obj_id_crud_v2({ api_cfg: api_cfg, obj_type: 'lu', for_obj_type: 'country_subdivision', // for_obj_id: account_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 + use_alt_tbl: false, + use_alt_mdl: false, enabled: enabled, hidden: hidden, order_by_li: order_by_li, diff --git a/src/lib/ae_core/core__time_zones.ts b/src/lib/ae_core/core__time_zones.ts index ddc46622..80cbb757 100644 --- a/src/lib/ae_core/core__time_zones.ts +++ b/src/lib/ae_core/core__time_zones.ts @@ -11,39 +11,46 @@ export async function load_ae_obj_li__time_zone( { api_cfg, // account_id, + enabled = 'enabled', + hidden = 'not_hidden', + limit = 99, + offset = 0, + // order_by_li = {'priority': 'DESC', 'group': 'ASC', 'sort': 'DESC', 'name': 'ASC'}, + order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC'}, params = {}, try_cache = true, log_lvl = 0 }: { api_cfg: any, // account_id: string, + enabled?: string, + hidden?: string, + limit?: number, + offset?: number, + order_by_li?: key_val, params?: key_val, try_cache?: boolean, log_lvl?: number } ) { - console.log(`*** load_ae_obj_li__time_zone() ***`); - - 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 ?? 625); // Actual is 594 in 2024 - let offset: number = (params.qry__offset ?? 0); // 0 - + if (log_lvl) { + console.log(`*** load_ae_obj_li__time_zone() ***`); + } let params_json: key_val = {}; // console.log('params_json:', params_json); - ae_promises.load__time_zone_li = await api.get_ae_obj_li_for_obj_id_crud({ + ae_promises.load__time_zone_li = await api.get_ae_obj_li_for_obj_id_crud_v2({ api_cfg: api_cfg, obj_type: 'lu', for_obj_type: 'time_zone', // for_obj_id: account_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 + use_alt_tbl: true, // NOTE: Using this with the time zones to use the view named "v_lu_time_zone_cust" + use_alt_mdl: false, enabled: enabled, hidden: hidden, - order_by_li: {'name': 'ASC'}, + order_by_li: order_by_li, limit: limit, offset: offset, params_json: params_json, diff --git a/src/lib/element_manage_hosted_file_li.svelte b/src/lib/element_manage_hosted_file_li.svelte index b0fa4bea..c568c7bf 100644 --- a/src/lib/element_manage_hosted_file_li.svelte +++ b/src/lib/element_manage_hosted_file_li.svelte @@ -116,7 +116,10 @@ ae_tmp.show__direct_download = $ae_loc.core?.show__direct_download ?? false;