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