refactor(badges): fix text search and standardize field mapping
- Renamed 'default_qry_string' to 'default_qry_str' across the Badge interface, Dexie schema, and API logic to resolve 400 'Unauthorized search field' errors. - Synchronized local Fast Path filtering with the correct database field names. - Hardened the reactive search pattern in '+page.svelte' to ensure end-to-sync consistency between local and background results.
This commit is contained in:
@@ -159,7 +159,7 @@ export interface Badge {
|
||||
|
||||
// data_json?: null|string;
|
||||
|
||||
default_qry_string?: null | string;
|
||||
default_qry_str?: null | string;
|
||||
|
||||
alert?: null | boolean;
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
const family_name = (badge.family_name ?? '').toLowerCase();
|
||||
const full_name = `${given_name} ${family_name}`.toLowerCase();
|
||||
const email = (badge.email ?? '').toLowerCase();
|
||||
const qry_string = (badge.default_qry_string ?? '').toLowerCase();
|
||||
const qry_string = (badge.default_qry_str ?? '').toLowerCase();
|
||||
|
||||
const match = full_name.includes(qry_str) ||
|
||||
given_name.includes(qry_str) ||
|
||||
@@ -207,10 +207,6 @@
|
||||
} catch (e) {
|
||||
if (log_lvl) console.warn('Badge Fast Path failed.', e);
|
||||
}
|
||||
} else {
|
||||
untrack(() => {
|
||||
event_badge_id_li = [];
|
||||
});
|
||||
}
|
||||
|
||||
// 3. REVALIDATE: API Request
|
||||
|
||||
Reference in New Issue
Block a user