Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
aminedhobb committed Oct 3, 2024
1 parent 23c7270 commit 8456bb3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def find_or_create_users
# rubocop:enable Metrics/AbcSize

def retrieve_user_organisation_ids(rdv_solidarites_user_id)
rdv_solidarites_organisation_ids = agents.first.with_rdv_solidarites_client do
rdv_solidarites_organisation_ids = agents.first.with_rdv_solidarites_session do
call_service!(RdvSolidaritesApi::RetrieveUser, rdv_solidarites_user_id:).user.organisation_ids
end
Organisation.where(rdv_solidarites_organisation_id: rdv_solidarites_organisation_ids).ids
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/agent/rdv_solidarites_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def rdv_solidarites_client
RdvSolidaritesClient.new(auth_headers: rdv_solidarites_auth_headers_with_shared_secret)
end

def with_rdv_solidarites_client(&)
def with_rdv_solidarites_session(&)
# This ensure Current.rdv_solidarites_client would call the agent rdv_solidarites_client
Current.agent = self
yield
Expand Down
2 changes: 1 addition & 1 deletion app/models/rdv_solidarites/user.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RdvSolidarites
class User < Base
RECORD_ATTRIBUTES = [
:id, :first_name, :last_name, :birth_date, :email, :sphone_number,
:id, :first_name, :last_name, :birth_date, :email, :phone_number,
:birth_name, :address, :affiliation_number
].freeze
attr_reader(*RECORD_ATTRIBUTES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(organisation_id:)

def call
# On prend le premier agent de l'organisation pour les appels à l'API RDVSP
@organisation.agents.first.with_rdv_solidarites_client do
@organisation.agents.first.with_rdv_solidarites_session do
process_invitations
process_invitations_params_without_creneau
result.grouped_invitation_params_by_category = @grouped_invitation_params_by_category
Expand Down
2 changes: 1 addition & 1 deletion lib/organisations/destroy_multiple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def display_organisation_info(organisation)
end

def organisation_exists_in_rdv_solidarites?(organisation)
organisation.agents.first.with_rdv_solidarites_client do
organisation.agents.first.with_rdv_solidarites_session do
RdvSolidaritesApi::RetrieveOrganisation
.call(rdv_solidarites_organisation_id: organisation.rdv_solidarites_organisation_id)
.success?
Expand Down

0 comments on commit 8456bb3

Please sign in to comment.