Skip to content

Commit 6610d80

Browse files
authored
Merge pull request #4144 from nhsuk/simplify-imms-logic
Simplify logic for next immunisations API action
2 parents 7be3a2f + 11af955 commit 6610d80

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/lib/nhs/immunisations_api.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,9 @@ def next_sync_action(vaccination_record)
197197

198198
return nil if last_synced_at >= sync_pending_at
199199

200-
if should_be_recorded && !is_recorded
201-
:create
202-
elsif should_be_recorded && is_recorded
200+
if should_be_recorded
203201
:update
204-
elsif is_recorded
202+
else
205203
discarded_at = vaccination_record.discarded_at
206204
:delete if discarded_at.nil? || last_synced_at < discarded_at
207205
end

0 commit comments

Comments
 (0)