Use bulk action to email payments
This commit is contained in:
parent
02b5b58e8b
commit
5cb136046f
|
|
@ -227,10 +227,10 @@ class RestorePaymentsFailure implements StopSaving {
|
|||
}
|
||||
|
||||
class EmailPaymentRequest implements StartSaving {
|
||||
EmailPaymentRequest(this.completer, this.payment);
|
||||
EmailPaymentRequest(this.completer, this.paymentIds);
|
||||
|
||||
final Completer completer;
|
||||
final PaymentEntity payment;
|
||||
final List<String> paymentIds;
|
||||
}
|
||||
|
||||
class EmailPaymentSuccess implements StopSaving, PersistData {}
|
||||
|
|
@ -348,7 +348,7 @@ void handlePaymentAction(
|
|||
case EntityAction.emailPayment:
|
||||
store.dispatch(EmailPaymentRequest(
|
||||
snackBarCompleter<Null>(context, localization.emailedPayment),
|
||||
payment));
|
||||
paymentIds));
|
||||
break;
|
||||
case EntityAction.restore:
|
||||
final message = paymentIds.length > 1
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ Middleware<AppState> _emailPayment(PaymentRepository repository) {
|
|||
return (Store<AppState> store, dynamic dynamicAction, NextDispatcher next) {
|
||||
final action = dynamicAction as EmailPaymentRequest;
|
||||
repository
|
||||
.bulkAction(store.state.credentials, [action.payment.id],
|
||||
.bulkAction(store.state.credentials, action.paymentIds,
|
||||
EntityAction.emailPayment)
|
||||
.then((List<PaymentEntity> payments) {
|
||||
action.completer.complete(null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue