http-request-manager 18.13.6 → 18.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6179,14 +6179,15 @@ class DbService extends Dexie {
|
|
|
6179
6179
|
}
|
|
6180
6180
|
getTable(tableName) {
|
|
6181
6181
|
try {
|
|
6182
|
-
return this.table(tableName);
|
|
6182
|
+
return this.table(this.cleanTableName(tableName));
|
|
6183
6183
|
}
|
|
6184
6184
|
catch (error) {
|
|
6185
6185
|
return undefined;
|
|
6186
6186
|
}
|
|
6187
6187
|
}
|
|
6188
6188
|
tableExists(tableName) {
|
|
6189
|
-
|
|
6189
|
+
const safe = this.cleanTableName(tableName);
|
|
6190
|
+
return this.tables.some(t => t.name === safe);
|
|
6190
6191
|
}
|
|
6191
6192
|
async updateTable(tableName, find, data) {
|
|
6192
6193
|
const table = this.getTable(tableName);
|
|
@@ -6210,7 +6211,8 @@ class DbService extends Dexie {
|
|
|
6210
6211
|
const currentSchema = this.getCurrentSchema();
|
|
6211
6212
|
const existingSchema = currentSchema[safeTableName]?.trim();
|
|
6212
6213
|
// No-op only when table already exists and schema is identical.
|
|
6213
|
-
|
|
6214
|
+
const normalize = (s) => (s ?? '').replace(/\s+/g, '');
|
|
6215
|
+
if (this.tableExists(safeTableName) && normalize(existingSchema) === normalize(safeSchema)) {
|
|
6214
6216
|
return;
|
|
6215
6217
|
}
|
|
6216
6218
|
console.log('Current Schema before update:', currentSchema);
|
|
@@ -6427,6 +6429,10 @@ class DatabaseManagerService extends DbService {
|
|
|
6427
6429
|
updateTableRecords(table, records) {
|
|
6428
6430
|
const tableName = this.cleanTableName(table);
|
|
6429
6431
|
return this.getDatabaseTable(tableName).pipe(switchMap((tableData) => {
|
|
6432
|
+
if (!tableData) {
|
|
6433
|
+
console.warn(`updateTableRecords: table "${tableName}" not found`);
|
|
6434
|
+
return of([]);
|
|
6435
|
+
}
|
|
6430
6436
|
const insertRecords = records.map((record) => {
|
|
6431
6437
|
const payload = { ...(record || {}) };
|
|
6432
6438
|
if (payload.id === undefined || payload.id === null || payload.id === '') {
|