Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPDNPQ-1188: Update only synced application with ecf #837

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading