fix(svelte): resolve props_invalid_value and dexie DataError
- Initialize ds_loaded properties in ae_stores.ts to fix svelte binding error. - Make db_save_ae_obj_li__ae_obj in core__idb_dexie.ts schema-aware to fix Dexie DataError when saving to tables with non-'id' primary keys.
This commit is contained in:
@@ -95,7 +95,8 @@ export async function db_save_ae_obj_li__ae_obj<T extends Record<string, any>>({
|
||||
return null; // Skip objects without a valid ID.
|
||||
}
|
||||
|
||||
(record as any).id = id;
|
||||
const primary_key_name = db_table.schema.primKey.name;
|
||||
(record as any)[primary_key_name] = id;
|
||||
return record;
|
||||
})
|
||||
.filter(Boolean) as T[];
|
||||
|
||||
Reference in New Issue
Block a user