Просмотр исходного кода

fix(core): Allow an Order in ArrangingAdditionalPayment to be cancelled

Fixes #1177
Michael Bromley 4 лет назад
Родитель
Сommit
3e1a3cf01a

+ 3 - 0
packages/core/src/service/helpers/order-state-machine/order-state-machine.ts

@@ -90,6 +90,9 @@ export class OrderStateMachine {
             }
         }
         if (fromState === 'ArrangingAdditionalPayment') {
+            if (toState === 'Cancelled') {
+                return;
+            }
             const existingPayments = await this.connection.getRepository(data.ctx, Payment).find({
                 relations: ['refunds'],
                 where: {