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:
@@ -36,18 +36,16 @@
|
||||
import { LoaderCircle } from 'lucide-svelte';
|
||||
|
||||
// *** Variables
|
||||
// let test_event_id = data.params.event_id;
|
||||
// Use page.params for robust reactivity in Svelte 5
|
||||
let event_badge_id = $derived(page.params.badge_id);
|
||||
|
||||
|
||||
// Track if we are waiting for initial IDB result
|
||||
let is_loading_idb = $state(true);
|
||||
|
||||
// console.log(`Data Params: event_id=${test_event_id}; badge_id=${test_event_badge_id}`);
|
||||
let url_test_val = $derived(data.url.searchParams.get('test_val'));
|
||||
$effect(() => {
|
||||
console.log(`URL test_val = ${url_test_val}`);
|
||||
});
|
||||
// let url_test_val = $derived(data.url.searchParams.get('test_val'));
|
||||
// $effect(() => {
|
||||
// console.log(`URL test_val = ${url_test_val}`);
|
||||
// });
|
||||
|
||||
let lq__event_badge_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
@@ -57,14 +55,7 @@
|
||||
`*** LiveQuery: lq__event_badge_obj *** event_badge_id=${event_badge_id}`
|
||||
);
|
||||
}
|
||||
// Attempt lookup by the ID provided in the URL
|
||||
let results = await db_events.badge.get(event_badge_id);
|
||||
|
||||
// Fallback: If not found by PK, try searching the event_badge_id index
|
||||
// (Standardizing on semantic IDs)
|
||||
if (!results) {
|
||||
results = await db_events.badge.where('event_badge_id').equals(event_badge_id).first();
|
||||
}
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user