Fix database offline record format bug & basic sync logic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Garrett Mills 2020-10-30 22:00:52 -05:00
parent 9258bf4d71
commit 708c029079
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
2 changed files with 11 additions and 4 deletions

View File

@ -66,7 +66,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
ngOnInit() {
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
console.log('database editor', this);
});
}

View File

@ -853,9 +853,9 @@ export class ApiService {
for ( const row of rowData ) {
const newDatabaseEntry = new DatabaseEntry(
row.DatabaseId,
JSON.stringify(row.RowData),
row.UUID || DatabaseEntry.getUUID(),
DatabaseId,
JSON.stringify(row),
DatabaseEntry.getUUID(),
true
);
@ -911,6 +911,13 @@ export class ApiService {
);
await newColumnDef.save();
// Add the column to the database's column IDs
const parentDatabase = await this.db.databases.where({ UUID: DatabaseId }).first() as Database;
if ( parentDatabase ) {
parentDatabase.ColumnIds.push(newColumnDef.UUID);
await parentDatabase.save();
}
}
}