mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-25 19:27:24 +02:00
client: Don't always delete persons from the server
This commit is contained in:
parent
86d4980459
commit
330fbb9b4b
1 changed files with 4 additions and 4 deletions
|
|
@ -178,7 +178,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
/// willl be thrown and the instrument will NOT be deleted.
|
||||
Future<void> deleteInstrument(int id, [bool sync = false]) async {
|
||||
if (sync) {
|
||||
await client.deletePerson(id);
|
||||
await client.deleteInstrument(id);
|
||||
}
|
||||
|
||||
await (delete(instruments)..where((i) => i.id.equals(id))).go();
|
||||
|
|
@ -311,7 +311,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
/// willl be thrown and the work will NOT be deleted.
|
||||
Future<void> deleteWork(int id, [bool sync = false]) async {
|
||||
if (sync) {
|
||||
await client.deletePerson(id);
|
||||
await client.deleteWork(id);
|
||||
}
|
||||
|
||||
// The parts and instrumentations will be deleted automatically due to
|
||||
|
|
@ -357,7 +357,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
/// willl be thrown and the ensemble will NOT be deleted.
|
||||
Future<void> deleteEnsemble(int id, [bool sync = false]) async {
|
||||
if (sync) {
|
||||
await client.deletePerson(id);
|
||||
await client.deleteEnsemble(id);
|
||||
}
|
||||
|
||||
await (delete(ensembles)..where((e) => e.id.equals(id))).go();
|
||||
|
|
@ -443,7 +443,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
/// willl be thrown and the recording will NOT be deleted.
|
||||
Future<void> deleteRecording(int id, [bool sync = false]) async {
|
||||
if (sync) {
|
||||
await client.deletePerson(id);
|
||||
await client.deleteRecording(id);
|
||||
}
|
||||
|
||||
// This will also delete the performances due to their foreign key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue