From f36b369d731a7a2d07e2a8fadf87cdfbe38a6e43 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 4 Sep 2019 21:06:01 +0200 Subject: [PATCH] Fix for #2483 --- app/Transformers/RecurrenceTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 2615418425..4bb67238e7 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -86,6 +86,7 @@ class RecurrenceTransformer extends AbstractTransformer $shortType = (string)config(sprintf('firefly.transactionTypesToShort.%s', $recurrence->transactionType->type)); $notes = $this->repository->getNoteText($recurrence); + $reps = 0 === (int)$recurrence->repetitions ? null : (int)$recurrence->repetitions; // basic data. $return = [ 'id' => (int)$recurrence->id, @@ -99,7 +100,7 @@ class RecurrenceTransformer extends AbstractTransformer 'repeat_until' => null === $recurrence->repeat_until ? null : $recurrence->repeat_until->format('Y-m-d'), 'apply_rules' => $recurrence->apply_rules, 'active' => $recurrence->active, - 'nr_of_repetitions' => $recurrence->repetitions, + 'nr_of_repetitions' => $reps, 'notes' => '' === $notes ? null : $notes, 'repetitions' => $this->getRepetitions($recurrence), 'transactions' => $this->getTransactions($recurrence),