Fix database offline record format bug & basic sync logic
continuous-integration/drone/push Build is passing Details

master
Garrett Mills 4 years ago
parent 9258bf4d71
commit 708c029079
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

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

@ -853,9 +853,9 @@ export class ApiService {
for ( const row of rowData ) { for ( const row of rowData ) {
const newDatabaseEntry = new DatabaseEntry( const newDatabaseEntry = new DatabaseEntry(
row.DatabaseId, DatabaseId,
JSON.stringify(row.RowData), JSON.stringify(row),
row.UUID || DatabaseEntry.getUUID(), DatabaseEntry.getUUID(),
true true
); );
@ -911,6 +911,13 @@ export class ApiService {
); );
await newColumnDef.save(); 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();
}
} }
} }

Loading…
Cancel
Save