Skip to content

Commit

Permalink
Merge pull request #837 from DFE-Digital/CPDNPQ-1188-update-only-sync…
Browse files Browse the repository at this point in the history
…ed-application-with-ecf

CPDNPQ-1188: Update only synced application with ecf
  • Loading branch information
javier-npq authored Jul 12, 2023
2 parents 0502bc6 + 4b51b9e commit 1248438
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/lib/services/ecf/ecf_application_synchronization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ def handle_response(response)
lead_provider_approval_status = record.lead_provider_approval_status
participant_outcome_state = record.participant_outcome_state

application = Application.find_by!(ecf_id: id)
application.update!(lead_provider_approval_status:, participant_outcome_state:)
application = Application.find_by(ecf_id: id)
if application.present?
application.update!(lead_provider_approval_status:, participant_outcome_state:)
else
Rails.logger.info("Application where ecf_id=#{id} is not synced yet")
end
end
else
raise "Failed to update application: #{response.message}"
Expand Down

0 comments on commit 1248438

Please sign in to comment.