More code clean up
This commit is contained in:
@@ -103,7 +103,7 @@ async function _refresh_event_v3_background({
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({
|
||||
const result = await api.get_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event',
|
||||
obj_id: event_id,
|
||||
@@ -267,7 +267,7 @@ export async function load_ae_obj_li__event({
|
||||
search_query.and.push({ field: `${for_obj_type}_id`, op: 'eq', value: for_obj_id });
|
||||
}
|
||||
|
||||
promise = api.search_ae_obj_v3({
|
||||
promise = api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
headers: { 'x-account-id': for_obj_id },
|
||||
@@ -281,7 +281,7 @@ export async function load_ae_obj_li__event({
|
||||
log_lvl
|
||||
});
|
||||
} else {
|
||||
promise = api.get_ae_obj_li_v3({
|
||||
promise = api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
for_obj_type,
|
||||
@@ -423,7 +423,7 @@ export async function delete_ae_obj_id__event({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_ae_obj_v3({
|
||||
const result = await api.delete_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
obj_id: event_id,
|
||||
@@ -557,7 +557,7 @@ export async function search__event({
|
||||
// meetings that are only physical or only virtual if both filters are active.
|
||||
// We handle this in the Client-side Filter Layer below for correct OR logic.
|
||||
|
||||
result_li = await api.search_ae_obj_v3({
|
||||
result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
headers: { 'x-account-id': for_obj_id },
|
||||
@@ -573,7 +573,7 @@ export async function search__event({
|
||||
});
|
||||
} else {
|
||||
// Option B: List All
|
||||
result_li = await api.get_ae_obj_li_v3({
|
||||
result_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
for_obj_type,
|
||||
|
||||
@@ -5,8 +5,8 @@ vi.mock('$lib/api/api', () => ({
|
||||
api: {
|
||||
create_nested_obj_v3: vi.fn(),
|
||||
update_nested_obj_v3: vi.fn(),
|
||||
delete_nested_ae_obj_v3: vi.fn(),
|
||||
search_ae_obj_v3: vi.fn()
|
||||
delete_nested_ae_obj: vi.fn(),
|
||||
search_ae_obj: vi.fn()
|
||||
}
|
||||
}));
|
||||
vi.mock('$lib/ae_core/core__idb_dexie', () => ({ db_save_ae_obj_li__ae_obj: vi.fn() }));
|
||||
@@ -71,9 +71,9 @@ describe('update_ae_obj__event_badge', () => {
|
||||
});
|
||||
|
||||
describe('delete_ae_obj_id__event_badge', () => {
|
||||
it('calls api.delete_nested_ae_obj_v3 and deletes from local DB when try_cache true', async () => {
|
||||
it('calls api.delete_nested_ae_obj and deletes from local DB when try_cache true', async () => {
|
||||
const mocked = await import('$lib/api/api');
|
||||
const mockDelete = mocked.api.delete_nested_ae_obj_v3 as any;
|
||||
const mockDelete = mocked.api.delete_nested_ae_obj as any;
|
||||
mockDelete.mockResolvedValue({ success: true });
|
||||
|
||||
const db = await import('$lib/ae_events/db_events');
|
||||
@@ -91,9 +91,9 @@ describe('delete_ae_obj_id__event_badge', () => {
|
||||
});
|
||||
|
||||
describe('search__event_badge', () => {
|
||||
it('calls api.search_ae_obj_v3 and returns list (handles data envelope)', async () => {
|
||||
it('calls api.search_ae_obj and returns list (handles data envelope)', async () => {
|
||||
const mocked = await import('$lib/api/api');
|
||||
const mockSearch = mocked.api.search_ae_obj_v3 as any;
|
||||
const mockSearch = mocked.api.search_ae_obj as any;
|
||||
const fakeList = [{ event_badge_id: 'eb1' }, { event_badge_id: 'eb2' }];
|
||||
mockSearch.mockResolvedValue({ data: fakeList });
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function load_ae_obj_id__event_badge({
|
||||
|
||||
try {
|
||||
ae_promises.load__event_badge_obj = await api
|
||||
.get_ae_obj_v3({
|
||||
.get_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge',
|
||||
obj_id: event_badge_id,
|
||||
@@ -135,7 +135,7 @@ export async function load_ae_obj_li__event_badge({
|
||||
|
||||
try {
|
||||
ae_promises.load__event_badge_obj_li = await api
|
||||
.get_ae_obj_li_v3({
|
||||
.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge',
|
||||
for_obj_type: 'event',
|
||||
@@ -278,7 +278,7 @@ export async function delete_ae_obj_id__event_badge({
|
||||
console.log(`*** delete_ae_obj_id__event_badge() *** event_badge_id=${event_badge_id}`);
|
||||
}
|
||||
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event',
|
||||
parent_id: event_id,
|
||||
@@ -455,7 +455,7 @@ export async function search__event_badge({
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: false });
|
||||
|
||||
ae_promises.search__event_badge_obj_li = await api
|
||||
.search_ae_obj_v3({
|
||||
.search_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_badge',
|
||||
search_query,
|
||||
|
||||
@@ -133,7 +133,7 @@ export async function load_ae_obj_id__event_badge_template({
|
||||
}
|
||||
|
||||
try {
|
||||
ae_promises.load__event_badge_template_obj = await api.get_ae_obj_v3({
|
||||
ae_promises.load__event_badge_template_obj = await api.get_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge_template',
|
||||
obj_id: event_badge_template_id,
|
||||
@@ -197,7 +197,7 @@ export async function load_ae_obj_li__event_badge_template({
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
try {
|
||||
ae_promises.load__event_badge_template_obj_li = await api.get_ae_obj_li_v3({
|
||||
ae_promises.load__event_badge_template_obj_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge_template',
|
||||
for_obj_type: 'event',
|
||||
@@ -296,7 +296,7 @@ export async function delete_ae_obj_id__event_badge_template({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -394,7 +394,7 @@ export async function search__event_badge_template({
|
||||
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: true });
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: false });
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge_template',
|
||||
search_query,
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function load_ae_obj_id__event_device({
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({
|
||||
const result = await api.get_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_device',
|
||||
obj_id: event_device_id,
|
||||
@@ -119,7 +119,7 @@ export async function load_ae_obj_li__event_device({
|
||||
}
|
||||
|
||||
try {
|
||||
const result_li = await api.get_ae_obj_li_v3({
|
||||
const result_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_device',
|
||||
for_obj_type,
|
||||
@@ -257,7 +257,7 @@ export async function delete_ae_obj_id__event_device({
|
||||
console.log(`*** delete_ae_obj_id__event_device() *** [V3] id=${event_device_id}`);
|
||||
}
|
||||
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -376,7 +376,7 @@ export async function search__event_device({
|
||||
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: true });
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: false });
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_device',
|
||||
search_query,
|
||||
@@ -524,7 +524,7 @@ export async function process_ae_obj__event_device_props({
|
||||
obj_type: 'event_device',
|
||||
log_lvl,
|
||||
specific_processor: (obj) => {
|
||||
// Note: V3 API returns proper ISO strings.
|
||||
// Note: V3 API returns proper ISO strings.
|
||||
// We no longer manually append 'Z' to avoid timezone corruption.
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ async function _refresh_file_id_background({
|
||||
}: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({
|
||||
const result = await api.get_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_file',
|
||||
obj_id: event_file_id,
|
||||
@@ -194,7 +194,7 @@ async function _refresh_file_li_background({
|
||||
console.log(`📡 [DEBUG] _refresh_file_li_background: Fetching files for ${for_obj_type}:${for_obj_id}`);
|
||||
}
|
||||
|
||||
const result_li = await api.get_ae_obj_li_v3({
|
||||
const result_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_file',
|
||||
for_obj_type,
|
||||
@@ -318,7 +318,7 @@ export async function delete_ae_obj_id__event_file({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_ae_obj_v3({
|
||||
const result = await api.delete_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_file',
|
||||
obj_id: event_file_id,
|
||||
@@ -427,7 +427,7 @@ export async function search__event_file({
|
||||
op: 'eq',
|
||||
value: qry_file_purpose
|
||||
});
|
||||
const result_li = await api.search_ae_obj_v3({
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_file',
|
||||
search_query,
|
||||
|
||||
@@ -45,40 +45,40 @@ export async function load_ae_obj_id__event_location({
|
||||
try {
|
||||
const cached = await db_events.location.get(event_location_id);
|
||||
if (cached) {
|
||||
_refresh_location_id_background({
|
||||
api_cfg, event_location_id, view, try_cache,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
_refresh_location_id_background({
|
||||
api_cfg, event_location_id, view, try_cache,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
});
|
||||
return await _handle_nested_loads(cached, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
return await _handle_nested_loads(cached, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// 2. SLOW PATH: Wait for API
|
||||
return await _refresh_location_id_background({
|
||||
api_cfg, event_location_id, view, try_cache,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
return await _refresh_location_id_background({
|
||||
api_cfg, event_location_id, view, try_cache,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
|
||||
async function _refresh_location_id_background({ api_cfg, event_location_id, view, try_cache, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_location', obj_id: event_location_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_location', obj_id: event_location_id, view, log_lvl });
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_location_props({ obj_li: [result], log_lvl });
|
||||
const processed_obj = processed[0];
|
||||
if (try_cache) {
|
||||
await db_save_ae_obj_li__ae_obj({ db_instance: db_events, table_name: 'location', obj_li: [processed_obj], properties_to_save, log_lvl });
|
||||
}
|
||||
return await _handle_nested_loads(processed_obj, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
return await _handle_nested_loads(processed_obj, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
} catch (e) {}
|
||||
@@ -137,16 +137,16 @@ export async function load_ae_obj_li__event_location({
|
||||
try {
|
||||
const cached_li = await db_events.location.where('event_id').equals(for_obj_id).toArray();
|
||||
if (cached_li && cached_li.length > 0) {
|
||||
_refresh_location_li_background({
|
||||
api_cfg, for_obj_type, for_obj_id,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
enabled, hidden, view, limit, offset, order_by_li, try_cache,
|
||||
log_lvl: 0
|
||||
_refresh_location_li_background({
|
||||
api_cfg, for_obj_type, for_obj_id,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
enabled, hidden, view, limit, offset, order_by_li, try_cache,
|
||||
log_lvl: 0
|
||||
});
|
||||
for (const loc of cached_li) {
|
||||
_handle_nested_loads(loc, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
_handle_nested_loads(loc, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
});
|
||||
}
|
||||
return cached_li;
|
||||
@@ -155,21 +155,21 @@ export async function load_ae_obj_li__event_location({
|
||||
}
|
||||
|
||||
// 2. SLOW PATH: API
|
||||
return await _refresh_location_li_background({
|
||||
api_cfg, for_obj_type, for_obj_id,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
enabled, hidden, view, limit, offset, order_by_li, try_cache,
|
||||
log_lvl
|
||||
return await _refresh_location_li_background({
|
||||
api_cfg, for_obj_type, for_obj_id,
|
||||
inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
enabled, hidden, view, limit, offset, order_by_li, try_cache,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
|
||||
async function _refresh_location_li_background({ api_cfg, for_obj_type, for_obj_id, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li, enabled, hidden, view, limit, offset, order_by_li, try_cache, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
const result_li = await api.get_ae_obj_li_v3({ api_cfg, obj_type: 'event_location', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
const result_li = await api.get_ae_obj_li({ api_cfg, obj_type: 'event_location', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_location_props({ obj_li: result_li, log_lvl });
|
||||
|
||||
|
||||
// String-Only ID Vision: Ensure linking ID is set for indexing
|
||||
if (for_obj_type === 'event') {
|
||||
processed.forEach(loc => loc.event_id = for_obj_id);
|
||||
@@ -179,9 +179,9 @@ async function _refresh_location_li_background({ api_cfg, for_obj_type, for_obj_
|
||||
await db_save_ae_obj_li__ae_obj({ db_instance: db_events, table_name: 'location', obj_li: processed, properties_to_save, log_lvl });
|
||||
}
|
||||
for (const loc of processed) {
|
||||
_handle_nested_loads(loc, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
_handle_nested_loads(loc, {
|
||||
api_cfg, inc_file_li, inc_session_li, inc_presentation_li, inc_presenter_li, inc_device_li, inc_all_file_li,
|
||||
log_lvl: 0
|
||||
});
|
||||
}
|
||||
return processed;
|
||||
@@ -208,9 +208,9 @@ async function _handle_nested_loads(location_obj: any, { api_cfg, inc_file_li, i
|
||||
if (inc_session_li) {
|
||||
tasks.push(load_ae_obj_li__event_session({
|
||||
api_cfg, for_obj_type: 'event_location', for_obj_id: current_location_id,
|
||||
inc_file_li: inc_all_file_li,
|
||||
inc_file_li: inc_all_file_li,
|
||||
inc_all_file_li: inc_all_file_li,
|
||||
inc_presentation_li: inc_presentation_li,
|
||||
inc_presentation_li: inc_presentation_li,
|
||||
inc_presenter_li: inc_presenter_li,
|
||||
enabled: 'enabled', hidden: 'not_hidden', limit: 150, log_lvl
|
||||
}).then(res => location_obj.event_session_obj_li = res));
|
||||
@@ -283,7 +283,7 @@ export async function delete_ae_obj_id__event_location({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -350,7 +350,7 @@ export async function search__event_location({
|
||||
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: true });
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: false });
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({ api_cfg, obj_type: 'event_location', search_query, order_by_li, view, limit, offset, log_lvl });
|
||||
const result_li = await api.search_ae_obj({ api_cfg, obj_type: 'event_location', search_query, order_by_li, view, limit, offset, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_location_props({ obj_li: result_li, log_lvl });
|
||||
if (try_cache) {
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function load_ae_obj_id__event_presentation({
|
||||
async function _refresh_presentation_id_background({ api_cfg, event_presentation_id, view, try_cache, inc_file_li, inc_presenter_li, enabled, hidden, limit, offset, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, view, log_lvl });
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presentation_props({ obj_li: [result], log_lvl });
|
||||
const processed_obj = processed[0];
|
||||
@@ -173,7 +173,7 @@ export async function load_ae_obj_li__event_presentation({
|
||||
async function _refresh_presentation_li_background({ api_cfg, for_obj_type, for_obj_id, inc_file_li, inc_presenter_li, enabled, hidden, view, limit, offset, order_by_li, try_cache, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
const result_li = await api.get_ae_obj_li_v3({ api_cfg, obj_type: 'event_presentation', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
const result_li = await api.get_ae_obj_li({ api_cfg, obj_type: 'event_presentation', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presentation_props({ obj_li: result_li, log_lvl });
|
||||
|
||||
@@ -258,7 +258,7 @@ export async function delete_ae_obj_id__event_presentation({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_ae_obj_v3({
|
||||
const result = await api.delete_ae_obj({
|
||||
api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, method, log_lvl
|
||||
});
|
||||
if (try_cache) await db_events.presentation.delete(event_presentation_id);
|
||||
@@ -308,7 +308,7 @@ export async function search__event_presentation({
|
||||
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 1 });
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 0 });
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({ api_cfg, obj_type: 'event_presentation', search_query, order_by_li, params, view, limit, offset, log_lvl });
|
||||
const result_li = await api.search_ae_obj({ api_cfg, obj_type: 'event_presentation', search_query, order_by_li, params, view, limit, offset, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presentation_props({ obj_li: result_li, log_lvl });
|
||||
if (try_cache) {
|
||||
|
||||
@@ -51,7 +51,7 @@ export async function load_ae_obj_id__event_presenter({
|
||||
async function _refresh_presenter_id_background({ api_cfg, event_presenter_id, view, try_cache, inc_file_li, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_presenter', obj_id: event_presenter_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_presenter', obj_id: event_presenter_id, view, log_lvl });
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presenter_props({ obj_li: [result], log_lvl });
|
||||
const processed_obj = processed[0];
|
||||
@@ -134,7 +134,7 @@ export async function load_ae_obj_li__event_presenter({
|
||||
async function _refresh_presenter_li_background({ api_cfg, for_obj_type, for_obj_id, inc_file_li, enabled, hidden, view, limit, offset, order_by_li, try_cache, log_lvl }: any) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
const result_li = await api.get_ae_obj_li_v3({ api_cfg, obj_type: 'event_presenter', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
const result_li = await api.get_ae_obj_li({ api_cfg, obj_type: 'event_presenter', for_obj_type, for_obj_id, enabled, hidden, view, limit, offset, order_by_li, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presenter_props({ obj_li: result_li, log_lvl });
|
||||
|
||||
@@ -244,7 +244,7 @@ export async function delete_ae_obj_id__event_presenter({
|
||||
console.error('delete_ae_obj_id__event_presenter: event_presentation_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event_presentation',
|
||||
for_obj_id: event_presentation_id,
|
||||
@@ -360,7 +360,7 @@ export async function search__event_presenter({
|
||||
if (hidden === 'hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 1 });
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 0 });
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({ api_cfg, obj_type: 'event_presenter', search_query, order_by_li, params, view, limit, offset, log_lvl });
|
||||
const result_li = await api.search_ae_obj({ api_cfg, obj_type: 'event_presenter', search_query, order_by_li, params, view, limit, offset, log_lvl });
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presenter_props({ obj_li: result_li, log_lvl });
|
||||
if (try_cache) {
|
||||
|
||||
@@ -90,7 +90,7 @@ async function _refresh_session_id_background({ api_cfg, event_session_id, view,
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_session_id: API Fetching id=${event_session_id}`);
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_session', obj_id: event_session_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_session', obj_id: event_session_id, view, log_lvl });
|
||||
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_session_props({ obj_li: [result], log_lvl });
|
||||
@@ -237,7 +237,7 @@ async function _refresh_session_li_background({ api_cfg, for_obj_type, for_obj_i
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_session_li: API Fetching for=${for_obj_type}:${for_obj_id} (view=${view})`);
|
||||
const result_li = await api.get_ae_obj_li_v3({ api_cfg, obj_type: 'event_session', for_obj_type, for_obj_id, view, enabled, hidden, limit, offset, order_by_li, log_lvl });
|
||||
const result_li = await api.get_ae_obj_li({ api_cfg, obj_type: 'event_session', for_obj_type, for_obj_id, view, enabled, hidden, limit, offset, order_by_li, log_lvl });
|
||||
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_session_props({ obj_li: result_li, log_lvl });
|
||||
@@ -327,7 +327,7 @@ export async function delete_ae_obj_id__event_session({
|
||||
console.error('delete_ae_obj_id__event_session: event_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
const result = await api.delete_nested_ae_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -407,7 +407,7 @@ export async function search__event_session({
|
||||
search_query.and.push({ field: 'event_location_name', op: 'eq', value: location_name });
|
||||
}
|
||||
|
||||
const result_li = await api.search_ae_obj_v3({ api_cfg, obj_type: 'event_session', search_query, order_by_li, view, limit, offset, log_lvl });
|
||||
const result_li = await api.search_ae_obj({ api_cfg, obj_type: 'event_session', search_query, order_by_li, view, limit, offset, log_lvl });
|
||||
|
||||
// Handle V3 API envelope
|
||||
let valid_result_li: ae_EventSession[] = [];
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function load_ae_obj_li__event_track({
|
||||
view?: string;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventTrack[]> {
|
||||
return await api.get_ae_obj_li_v3({
|
||||
return await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_track',
|
||||
for_obj_type: 'event',
|
||||
|
||||
@@ -166,7 +166,7 @@ async function _refresh_exhibit_id_background({ api_cfg, exhibit_id, view, try_c
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_exhibit_id: API Fetching id=${exhibit_id}`);
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_exhibit', obj_id: exhibit_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_exhibit', obj_id: exhibit_id, view, log_lvl });
|
||||
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__exhibit_props({ obj_li: [result], log_lvl });
|
||||
@@ -255,7 +255,7 @@ async function _refresh_exhibit_li_background({ api_cfg, event_id, enabled, hidd
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_exhibit_li: API Fetching exhibits for event=${event_id}`);
|
||||
const result_li = await api.get_ae_obj_li_v3({
|
||||
const result_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_exhibit',
|
||||
for_obj_type: 'event',
|
||||
@@ -429,7 +429,7 @@ export async function search__exhibit({
|
||||
else if (priority === 'not_priority') search_query.and.push({ field: 'priority', op: 'eq', value: 0 });
|
||||
|
||||
try {
|
||||
const result_li = await api.search_ae_obj_v3({
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_exhibit',
|
||||
search_query,
|
||||
|
||||
@@ -86,7 +86,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
// 2. Primary Key Mapping (Dexie compatible)
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
const baseIdKey = `${obj_type}_id`;
|
||||
|
||||
|
||||
// Prioritize the base ID field as the primary source of truth
|
||||
if (processed_obj[baseIdKey]) {
|
||||
(processed_obj as any).id = String(processed_obj[baseIdKey]);
|
||||
@@ -180,7 +180,7 @@ async function _refresh_tracking_id_background({ api_cfg, exhibit_tracking_id, v
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return null;
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_tracking_id: API Fetching id=${exhibit_tracking_id}`);
|
||||
const result = await api.get_ae_obj_v3({ api_cfg, obj_type: 'event_exhibit_tracking', obj_id: exhibit_tracking_id, view, log_lvl });
|
||||
const result = await api.get_ae_obj({ api_cfg, obj_type: 'event_exhibit_tracking', obj_id: exhibit_tracking_id, view, log_lvl });
|
||||
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__exhibit_tracking_props({ obj_li: [result], log_lvl });
|
||||
@@ -268,7 +268,7 @@ async function _refresh_tracking_li_background({ api_cfg, exhibit_id, enabled, h
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) return [];
|
||||
try {
|
||||
if (log_lvl) console.log(`📡 [Trace] _refresh_tracking_li: API Fetching leads for exhibit=${exhibit_id}`);
|
||||
const result_li = await api.get_ae_obj_li_v3({
|
||||
const result_li = await api.get_ae_obj_li({
|
||||
api_cfg,
|
||||
obj_type: 'event_exhibit_tracking',
|
||||
for_obj_type: 'event_exhibit',
|
||||
@@ -509,7 +509,7 @@ export async function search__exhibit_tracking({
|
||||
else if (hidden === 'not_hidden') search_query.and.push({ field: 'hide', op: 'eq', value: 0 });
|
||||
|
||||
try {
|
||||
const result_li = await api.search_ae_obj_v3({
|
||||
const result_li = await api.search_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_exhibit_tracking',
|
||||
for_obj_type: 'event_exhibit',
|
||||
|
||||
Reference in New Issue
Block a user