Implemented Aether API V3 Lookup integration for standardized tables.
- Created 'src/lib/ae_api/api_get__lookup_v3.ts' to handle the new '/v3/lookup/{lu_type}/list' endpoint.
- Refactored 'get_ae_obj_li_for_lu' in 'api.ts' to prioritize the V3 system for countries, subdivisions, and time zones, with V2 fallback for legacy types.
- Ensured lookups use the 'x-no-account-id' bypass for unauthenticated site bootstrapping.
- Updated core country, subdivision, and time zone loaders to use the refined API interface.
This commit is contained in:
@@ -11,7 +11,7 @@ export async function load_ae_obj_li__country({
|
||||
// account_id,
|
||||
enabled = 'enabled',
|
||||
hidden = 'not_hidden',
|
||||
limit = 299,
|
||||
limit = 275, // There are roughly 249 as of 2026-02
|
||||
offset = 0,
|
||||
order_by_li = { sort: 'DESC', english_short_name: 'ASC', alpha_2_code: 'ASC' } as const,
|
||||
params = {},
|
||||
@@ -38,19 +38,13 @@ export async function load_ae_obj_li__country({
|
||||
// console.log('params_json:', params_json);
|
||||
|
||||
ae_promises.load__country_li = await api
|
||||
.get_ae_obj_li_for_obj_id_crud_v2({
|
||||
.get_ae_obj_li_for_lu({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'lu',
|
||||
for_obj_type: 'country',
|
||||
// for_obj_id: account_id,
|
||||
use_alt_tbl: false,
|
||||
use_alt_mdl: false,
|
||||
for_lu_type: 'country',
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: order_by_li,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ export async function load_ae_obj_li__country_subdivision({
|
||||
// account_id,
|
||||
enabled = 'enabled',
|
||||
hidden = 'not_hidden',
|
||||
limit = 399,
|
||||
limit = 3500, // There are roughly 3434 as of 2026-02
|
||||
offset = 0,
|
||||
order_by_li = { sort: 'DESC', name: 'ASC', code: 'ASC' } as const,
|
||||
params = {},
|
||||
@@ -38,19 +38,13 @@ export async function load_ae_obj_li__country_subdivision({
|
||||
// console.log('params_json:', params_json);
|
||||
|
||||
ae_promises.load__country_subdivision_li = await api
|
||||
.get_ae_obj_li_for_obj_id_crud_v2({
|
||||
.get_ae_obj_li_for_lu({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'lu',
|
||||
for_obj_type: 'country_subdivision',
|
||||
// for_obj_id: account_id,
|
||||
use_alt_tbl: false,
|
||||
use_alt_mdl: false,
|
||||
for_lu_type: 'country_subdivision',
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: order_by_li,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ export async function load_ae_obj_li__time_zone({
|
||||
// account_id,
|
||||
enabled = 'enabled',
|
||||
hidden = 'not_hidden',
|
||||
limit = 99,
|
||||
limit = 1800, // There are roughly 1780 as of 2026-02
|
||||
offset = 0,
|
||||
// order_by_li = {'priority': 'DESC', 'group': 'ASC', 'sort': 'DESC', 'name': 'ASC'},
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', name: 'ASC' } as const,
|
||||
@@ -39,19 +39,13 @@ export async function load_ae_obj_li__time_zone({
|
||||
// console.log('params_json:', params_json);
|
||||
|
||||
ae_promises.load__time_zone_li = await api
|
||||
.get_ae_obj_li_for_obj_id_crud_v2({
|
||||
.get_ae_obj_li_for_lu({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'lu',
|
||||
for_obj_type: 'time_zone',
|
||||
// for_obj_id: account_id,
|
||||
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,
|
||||
for_lu_type: 'time_zone',
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: order_by_li,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user