Migrate Event and EventBadge modules to unified type system
- Updated ae_types.ts with ae_Event, ae_EventBadge, and ae_EventBadgeTemplate interfaces. - Standardized return types (Promise<ae_Event[]>, etc.) for all core loading and CRUD functions in Events module. - Integrated triple-ID patterns for Dexie and V3 API parity in event-related objects. - Cleaned up local interface redundancies in favor of unified imports.
This commit is contained in:
@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
import type { ae_Event } from '$lib/types/ae_types';
|
||||
|
||||
import { load_ae_obj_li__event_device } from './ae_events__event_device';
|
||||
import { load_ae_obj_li__event_location } from './ae_events__event_location';
|
||||
@@ -32,7 +33,7 @@ export async function load_ae_obj_id__event({
|
||||
inc_template_li?: boolean;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__event() *** event_id=${event_id}`);
|
||||
}
|
||||
@@ -124,10 +125,10 @@ export async function load_ae_obj_li__event({
|
||||
view?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'>;
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event[]> {
|
||||
let promise;
|
||||
|
||||
if (qry_conference !== null) {
|
||||
@@ -212,7 +213,7 @@ export async function create_ae_obj__event({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
@@ -288,7 +289,7 @@ export async function update_ae_obj__event({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
|
||||
Reference in New Issue
Block a user