feat: standardize OrderBy types and fix data model mismatches
- Update ae_types.ts with joined fields for deep layout loading - Fix OrderBy vs OrderBy[] type mismatch in API v2/v3 and generic CRUD - Apply 'as const' to order_by_li defaults in core/event libraries - Resolve type errors in reports_presenters and reports_files Svelte components
This commit is contained in:
@@ -69,7 +69,7 @@ interface GetAeObjLiForObjIdCrudV2Params {
|
||||
inc?: key_val;
|
||||
enabled?: 'all' | 'enabled' | 'not_enabled';
|
||||
hidden?: 'all' | 'hidden' | 'not_hidden';
|
||||
order_by_li?: OrderBy[] | null;
|
||||
order_by_li?: OrderBy | OrderBy[] | null;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
headers?: Record<string, string>;
|
||||
|
||||
@@ -95,7 +95,7 @@ interface GetAeObjLiV3Params {
|
||||
view?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | null;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[] | null;
|
||||
delay_ms?: number;
|
||||
log_lvl?: number;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ interface GetNestedObjLiV3Params {
|
||||
view?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | null;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[] | null;
|
||||
delay_ms?: number;
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function load_ae_obj_li__country({
|
||||
hidden = 'not_hidden',
|
||||
limit = 299,
|
||||
offset = 0,
|
||||
order_by_li = { sort: 'DESC', english_short_name: 'ASC', alpha_2_code: 'ASC' },
|
||||
order_by_li = { sort: 'DESC', english_short_name: 'ASC', alpha_2_code: 'ASC' } as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function load_ae_obj_li__country_subdivision({
|
||||
hidden = 'not_hidden',
|
||||
limit = 399,
|
||||
offset = 0,
|
||||
order_by_li = { sort: 'DESC', name: 'ASC', code: 'ASC' },
|
||||
order_by_li = { sort: 'DESC', name: 'ASC', code: 'ASC' } as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface GenericCrudArgs {
|
||||
hidden?: 'not_hidden' | 'hidden' | 'all';
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by_li?: key_val;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[] | null;
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
|
||||
@@ -63,7 +63,12 @@ export async function load_ae_obj_li__hosted_file({
|
||||
hidden = 'not_hidden',
|
||||
limit = 99,
|
||||
offset = 0,
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', updated_on: 'DESC', created_on: 'DESC' },
|
||||
order_by_li = {
|
||||
priority: 'DESC',
|
||||
sort: 'DESC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function load_ae_obj_li__time_zone({
|
||||
limit = 99,
|
||||
offset = 0,
|
||||
// order_by_li = {'priority': 'DESC', 'group': 'ASC', 'sort': 'DESC', 'name': 'ASC'},
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', name: 'ASC' },
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', name: 'ASC' } as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -112,7 +112,7 @@ export async function load_ae_obj_li__event({
|
||||
view = 'default',
|
||||
limit = 99,
|
||||
offset = 0,
|
||||
order_by_li = { start_datetime: 'DESC' },
|
||||
order_by_li = { start_datetime: 'DESC' } as const,
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
@@ -328,7 +328,7 @@ export async function qry_ae_obj_li__event({
|
||||
view = 'default',
|
||||
limit = 99,
|
||||
offset = 0,
|
||||
order_by_li = { start_datetime: 'DESC' },
|
||||
order_by_li = { start_datetime: 'DESC' } as const,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any;
|
||||
|
||||
@@ -235,7 +235,13 @@ export async function load_ae_obj_li__event_badge_template({
|
||||
hidden = 'not_hidden',
|
||||
limit = 49,
|
||||
offset = 0,
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', updated_on: 'DESC', created_on: 'DESC' },
|
||||
order_by_li = {
|
||||
priority: 'DESC',
|
||||
sort: 'DESC',
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -475,7 +481,7 @@ export async function search__event_badge_template({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -119,7 +119,7 @@ export async function load_ae_obj_li__event_device({
|
||||
code: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -547,7 +547,7 @@ export async function search__event_device({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
};
|
||||
} as const;
|
||||
|
||||
// ae_promises.load__event_device_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
ae_promises.load__event_device_obj_li = await api
|
||||
|
||||
@@ -86,7 +86,12 @@ export async function load_ae_obj_li__event_file({
|
||||
hidden = 'not_hidden',
|
||||
limit = 99,
|
||||
offset = 0,
|
||||
order_by_li = { priority: 'DESC', sort: 'DESC', updated_on: 'DESC', created_on: 'DESC' },
|
||||
order_by_li = {
|
||||
priority: 'DESC',
|
||||
sort: 'DESC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -397,7 +402,7 @@ export async function qry__event_file({
|
||||
filename: 'ASC',
|
||||
extension: 'ASC',
|
||||
hosted_file_size: 'ASC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -541,7 +546,7 @@ export async function search__event_file({
|
||||
filename: 'ASC',
|
||||
extension: 'ASC',
|
||||
hosted_file_size: 'ASC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -656,7 +656,7 @@ export async function search__event_location({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
};
|
||||
} as const;
|
||||
|
||||
// ae_promises.load__event_location_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
ae_promises.load__event_location_obj_li = await api
|
||||
|
||||
@@ -185,7 +185,7 @@ export async function load_ae_obj_li__event_presentation({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -137,7 +137,7 @@ export async function load_ae_obj_li__event_presenter({
|
||||
family_name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -520,7 +520,7 @@ export async function search__event_presenter({
|
||||
email: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -187,7 +187,7 @@ export async function load_ae_obj_li__event_session({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -608,7 +608,7 @@ export async function qry__event_session({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
@@ -797,7 +797,7 @@ export async function search__event_session({
|
||||
name: 'ASC',
|
||||
updated_on: 'DESC',
|
||||
created_on: 'DESC'
|
||||
},
|
||||
} as const,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
|
||||
@@ -101,6 +101,16 @@ export interface ae_SiteDomain extends ae_BaseObj {
|
||||
redirect_to_primary?: boolean;
|
||||
|
||||
access_key?: string;
|
||||
|
||||
// Joined fields for bootstrap lookup
|
||||
account_code?: string;
|
||||
account_name?: string;
|
||||
header_image_path?: string;
|
||||
style_href?: string;
|
||||
google_tracking_id?: string;
|
||||
access_code_kv_json?: any;
|
||||
cfg_json?: any;
|
||||
site_domain_access_key?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -407,6 +417,10 @@ export interface ae_Event extends ae_BaseObj {
|
||||
|
||||
cfg_json?: any;
|
||||
data_json?: any;
|
||||
|
||||
// Joined view fields
|
||||
event_location_obj_li?: ae_EventLocation[];
|
||||
event_session_obj_li?: ae_EventSession[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -537,6 +551,9 @@ export interface ae_EventSession extends ae_BaseObj {
|
||||
ready?: boolean;
|
||||
|
||||
data_json?: any;
|
||||
|
||||
// Joined fields
|
||||
event_presentation_li?: ae_EventPresentation[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -557,6 +574,9 @@ export interface ae_EventPresentation extends ae_BaseObj {
|
||||
|
||||
passcode?: string;
|
||||
file_count?: number;
|
||||
|
||||
// Joined fields
|
||||
event_presenter_li?: ae_EventPresenter[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user