Remove duplicate PersistDatas
This commit is contained in:
parent
3ec888720a
commit
25db10afc8
|
|
@ -188,21 +188,19 @@ class SaveInvoiceRequest implements StartSaving {
|
|||
SaveInvoiceRequest({
|
||||
this.completer,
|
||||
this.invoice,
|
||||
this.refreshData = true,
|
||||
});
|
||||
|
||||
final Completer completer;
|
||||
final InvoiceEntity invoice;
|
||||
final bool refreshData;
|
||||
}
|
||||
|
||||
class SaveInvoiceSuccess implements StopSaving, PersistData, PersistUI {
|
||||
class SaveInvoiceSuccess implements StopSaving, PersistUI {
|
||||
SaveInvoiceSuccess(this.invoice);
|
||||
|
||||
final InvoiceEntity invoice;
|
||||
}
|
||||
|
||||
class AddInvoiceSuccess implements StopSaving, PersistData, PersistUI {
|
||||
class AddInvoiceSuccess implements StopSaving, PersistUI {
|
||||
AddInvoiceSuccess(this.invoice);
|
||||
|
||||
final InvoiceEntity invoice;
|
||||
|
|
@ -282,7 +280,7 @@ class MarkInvoicesPaidRequest implements StartSaving {
|
|||
final List<String> invoiceIds;
|
||||
}
|
||||
|
||||
class MarkInvoicesPaidSuccess implements StopSaving, PersistData {
|
||||
class MarkInvoicesPaidSuccess implements StopSaving {
|
||||
MarkInvoicesPaidSuccess(this.invoices);
|
||||
|
||||
final List<InvoiceEntity> invoices;
|
||||
|
|
@ -301,7 +299,7 @@ class ReverseInvoicesRequest implements StartSaving {
|
|||
final List<String> invoiceIds;
|
||||
}
|
||||
|
||||
class ReverseInvoicesSuccess implements StopSaving, PersistData {
|
||||
class ReverseInvoicesSuccess implements StopSaving {
|
||||
ReverseInvoicesSuccess(this.invoices);
|
||||
|
||||
final List<InvoiceEntity> invoices;
|
||||
|
|
@ -320,7 +318,7 @@ class CancelInvoicesRequest implements StartSaving {
|
|||
final List<String> invoiceIds;
|
||||
}
|
||||
|
||||
class CancelInvoicesSuccess implements StopSaving, PersistData {
|
||||
class CancelInvoicesSuccess implements StopSaving {
|
||||
CancelInvoicesSuccess(this.invoices);
|
||||
|
||||
final List<InvoiceEntity> invoices;
|
||||
|
|
|
|||
|
|
@ -410,9 +410,7 @@ Middleware<AppState> _saveInvoice(InvoiceRepository repository) {
|
|||
} else {
|
||||
store.dispatch(SaveInvoiceSuccess(invoice));
|
||||
}
|
||||
if (action.refreshData) {
|
||||
store.dispatch(RefreshData());
|
||||
}
|
||||
action.completer.complete(invoice);
|
||||
}).catchError((Object error) {
|
||||
print(error);
|
||||
|
|
|
|||
|
|
@ -128,13 +128,13 @@ class SavePaymentRequest implements StartSaving {
|
|||
final PaymentEntity payment;
|
||||
}
|
||||
|
||||
class SavePaymentSuccess implements StopSaving, PersistData, PersistUI {
|
||||
class SavePaymentSuccess implements StopSaving, PersistUI {
|
||||
SavePaymentSuccess(this.payment);
|
||||
|
||||
final PaymentEntity payment;
|
||||
}
|
||||
|
||||
class AddPaymentSuccess implements StopSaving, PersistData, PersistUI {
|
||||
class AddPaymentSuccess implements StopSaving, PersistUI {
|
||||
AddPaymentSuccess(this.payment);
|
||||
|
||||
final PaymentEntity payment;
|
||||
|
|
@ -156,7 +156,7 @@ class RefundPaymentRequest implements StartSaving {
|
|||
final PaymentEntity payment;
|
||||
}
|
||||
|
||||
class RefundPaymentSuccess implements StopSaving, PersistData, PersistUI {
|
||||
class RefundPaymentSuccess implements StopSaving, PersistUI {
|
||||
RefundPaymentSuccess(this.payment);
|
||||
|
||||
final PaymentEntity payment;
|
||||
|
|
@ -194,7 +194,7 @@ class DeletePaymentsRequest implements StartSaving {
|
|||
final List<String> paymentIds;
|
||||
}
|
||||
|
||||
class DeletePaymentsSuccess implements StopSaving, PersistData {
|
||||
class DeletePaymentsSuccess implements StopSaving {
|
||||
DeletePaymentsSuccess(this.payments);
|
||||
|
||||
final List<PaymentEntity> payments;
|
||||
|
|
@ -213,7 +213,7 @@ class RestorePaymentsRequest implements StartSaving {
|
|||
final List<String> paymentIds;
|
||||
}
|
||||
|
||||
class RestorePaymentsSuccess implements StopSaving, PersistData {
|
||||
class RestorePaymentsSuccess implements StopSaving {
|
||||
RestorePaymentsSuccess(this.payments);
|
||||
|
||||
final List<PaymentEntity> payments;
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ class ConvertQuotes implements StartSaving {
|
|||
final Completer completer;
|
||||
}
|
||||
|
||||
class ConvertQuoteSuccess implements StopSaving, PersistData {
|
||||
class ConvertQuoteSuccess implements StopSaving {
|
||||
ConvertQuoteSuccess({this.quotes});
|
||||
|
||||
final List<InvoiceEntity> quotes;
|
||||
|
|
|
|||
|
|
@ -108,12 +108,10 @@ class InvoiceEditVM extends EntityEditVM {
|
|||
return null;
|
||||
}
|
||||
final Completer<InvoiceEntity> completer = Completer<InvoiceEntity>();
|
||||
final refreshData =
|
||||
![EntityAction.markSent, EntityAction.markPaid].contains(action);
|
||||
store.dispatch(SaveInvoiceRequest(
|
||||
completer: completer,
|
||||
invoice: invoice,
|
||||
refreshData: refreshData));
|
||||
));
|
||||
return completer.future.then((savedInvoice) {
|
||||
showToast(invoice.isNew
|
||||
? localization.createdInvoice
|
||||
|
|
|
|||
21
pubspec.lock
21
pubspec.lock
|
|
@ -15,6 +15,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.7.1"
|
||||
ansicolor:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ansicolor
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -502,6 +509,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
injector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: injector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -593,6 +607,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
msix:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: msix
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
native_pdf_renderer:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ dev_dependencies:
|
|||
build_runner: ^2.1.0
|
||||
built_value_generator: ^8.1.1
|
||||
faker: ^2.0.0
|
||||
msix: ^2.1.3
|
||||
|
||||
flutter:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue