refactor(events, idaa): standardize on String-only IDs and remove '_random' suffix
Aligned the Events Badges, Templates, and IDAA Bulletin Board modules with Aether UI/UX v3 standards by prioritizing semantic String IDs (e.g., event_id, badge_id) over legacy '_random' variants in API helpers, Dexie processors, and UI components. - Refactored badge and template loaders to use clean ID field names. - Updated search and LiveQuery logic in badge management views. - Cleaned up unused imports and legacy code in +layout and +page components. - Standardized ID mapping in generic object processors. - Improved IDAA post creation UX with autofocus and empty title defaults.
This commit is contained in:
@@ -74,7 +74,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
(processed_obj as any)[newKey] = processed_obj[key];
|
||||
}
|
||||
}
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
const randomIdKey = `${obj_type}_id`;
|
||||
if (processed_obj[randomIdKey]) {
|
||||
(processed_obj as any).id = processed_obj[randomIdKey];
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export async function load_ae_obj_id__event_badge_template({
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__event_badge_template() *** [V3] id=${event_badge_template_id}`);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
ae_promises.load__event_badge_template_obj = await api.get_ae_obj_v3({
|
||||
api_cfg,
|
||||
@@ -161,7 +161,7 @@ export async function load_ae_obj_id__event_badge_template({
|
||||
ae_promises.load__event_badge_template_obj = await db_events.badge_template.get(event_badge_template_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ae_promises.load__event_badge_template_obj || null;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ export async function load_ae_obj_li__event_badge_template({
|
||||
.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ae_promises.load__event_badge_template_obj_li || [];
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ export async function create_ae_obj__event_badge_template({
|
||||
api_cfg,
|
||||
obj_type: 'event_badge_template',
|
||||
fields: {
|
||||
event_id_random: event_id,
|
||||
event_id: event_id,
|
||||
...data_kv
|
||||
},
|
||||
log_lvl
|
||||
@@ -376,7 +376,7 @@ export async function search__event_badge_template({
|
||||
}) {
|
||||
const search_query: any = {
|
||||
q: qry_str,
|
||||
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
|
||||
and: [{ field: 'event_id', op: 'eq', value: event_id }]
|
||||
};
|
||||
|
||||
if (enabled === 'enabled') search_query.and.push({ field: 'enable', op: 'eq', value: true });
|
||||
|
||||
Reference in New Issue
Block a user