fix: resolve TypeErrors in core, events, and journals modules
- Core: Use FormData in video clip components to fix EventTarget errors. - DB: Rename 'File' to 'ae_LocalFile' in db_core to prevent DOM type shadowing. - API: Strictly type 'order_by_li' across archives, events, and journals to match API definition. - API: Fix 'enabled'/'hidden' parameter types in search functions. - Generics: Add 'any' cast to 'processed_obj' in generic processors to fix indexing errors. - Journals: Update journal_entry creation to return null on failure, fix missing ID fields in DB save.
This commit is contained in:
@@ -132,6 +132,7 @@ export async function load_ae_obj_li__event_device({
|
||||
hidden?: 'hidden' | 'all' | 'not_hidden' | undefined; // all, hidden, not_hidden
|
||||
limit?: number; // 99
|
||||
offset?: number; // 0
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[];
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
@@ -485,8 +486,8 @@ export async function search__event_device({
|
||||
console.log(`*** search__event_device() *** event_id=${event_id}`);
|
||||
}
|
||||
|
||||
const enabled: string = params.qry__enabled ?? 'enabled'; // all, disabled, enabled
|
||||
const hidden: string = params.qry__hidden ?? 'not_hidden'; // all, hidden, not_hidden
|
||||
const enabled: 'enabled' | 'all' | 'not_enabled' = (params.qry__enabled as any) ?? 'enabled';
|
||||
const hidden: 'hidden' | 'all' | 'not_hidden' = (params.qry__hidden as any) ?? 'not_hidden';
|
||||
const limit: number = params.qry__limit ?? 25; // 99
|
||||
const offset: number = params.qry__offset ?? 0; // 0
|
||||
|
||||
@@ -720,7 +721,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
for (const key in processed_obj) {
|
||||
if (key.endsWith('_random')) {
|
||||
const newKey = key.slice(0, -7); // Remove '_random' suffix
|
||||
processed_obj[newKey] = processed_obj[key];
|
||||
(processed_obj as any)[newKey] = processed_obj[key];
|
||||
}
|
||||
}
|
||||
// Ensure 'id' is set from '[obj_type]_id_random'
|
||||
|
||||
Reference in New Issue
Block a user