diff --git a/common/lib/src/editors/ensemble.dart b/common/lib/src/editors/ensemble.dart index 9ea9d8c..d70e25e 100644 --- a/common/lib/src/editors/ensemble.dart +++ b/common/lib/src/editors/ensemble.dart @@ -64,19 +64,13 @@ class _EnsembleEditorState extends State { synced: false, ); - final success = await backend.client.putEnsemble(ensemble); + await backend.db.updateEnsemble(ensemble); setState(() { uploading = false; }); - if (success) { - Navigator.pop(context, ensemble); - } else { - Scaffold.of(context).showSnackBar(SnackBar( - content: Text('Failed to upload'), - )); - } + Navigator.pop(context, ensemble); }, ), ], diff --git a/common/lib/src/editors/instrument.dart b/common/lib/src/editors/instrument.dart index b48eb99..22fc09c 100644 --- a/common/lib/src/editors/instrument.dart +++ b/common/lib/src/editors/instrument.dart @@ -64,20 +64,13 @@ class _InstrumentEditorState extends State { synced: false, ); - final success = - await backend.client.putInstrument(instrument); + await backend.db.updateInstrument(instrument); setState(() { uploading = false; }); - if (success) { - Navigator.pop(context, instrument); - } else { - Scaffold.of(context).showSnackBar(SnackBar( - content: Text('Failed to upload'), - )); - } + Navigator.pop(context, instrument); }, ), ], diff --git a/common/lib/src/editors/person.dart b/common/lib/src/editors/person.dart index c91bf47..6b0c4cd 100644 --- a/common/lib/src/editors/person.dart +++ b/common/lib/src/editors/person.dart @@ -67,19 +67,13 @@ class _PersonEditorState extends State { synced: false, ); - final success = await backend.client.putPerson(person); + await backend.db.updatePerson(person); setState(() { uploading = false; }); - if (success) { - Navigator.pop(context, person); - } else { - Scaffold.of(context).showSnackBar(SnackBar( - content: Text('Failed to upload'), - )); - } + Navigator.pop(context, person); }, ), ], diff --git a/common/lib/src/editors/recording.dart b/common/lib/src/editors/recording.dart index fa83ef8..f1ef806 100644 --- a/common/lib/src/editors/recording.dart +++ b/common/lib/src/editors/recording.dart @@ -144,26 +144,19 @@ class _RecordingEditorState extends State { performances: _performanceInfos, ); - final success = - await _backend.client.putRecording(recordingInfo); + await _backend.db.updateRecording(recordingInfo); setState(() { _uploading = false; }); - if (success) { - Navigator.pop( - context, - RecordingSelectorResult( - workInfo: _workInfo, - recordingInfo: recordingInfo, - ), - ); - } else { - Scaffold.of(context).showSnackBar(SnackBar( - content: Text('Failed to upload'), - )); - } + Navigator.pop( + context, + RecordingSelectorResult( + workInfo: _workInfo, + recordingInfo: recordingInfo, + ), + ); }, ), ], diff --git a/common/lib/src/editors/work.dart b/common/lib/src/editors/work.dart index a4e4e03..a121462 100644 --- a/common/lib/src/editors/work.dart +++ b/common/lib/src/editors/work.dart @@ -322,19 +322,13 @@ class _WorkEditorState extends State { sections: sections, ); - final success = await backend.client.putWork(workInfo); + await backend.db.updateWork(workInfo); setState(() { uploading = false; }); - if (success) { - Navigator.pop(context, workInfo); - } else { - Scaffold.of(context).showSnackBar(SnackBar( - content: Text('Failed to upload'), - )); - } + Navigator.pop(context, workInfo); }, ), ],