Merge pull request #5337 from betagouv/fix-broken-empty-demandes-screen
fix demandes adapter when no demandes
This commit is contained in:
commit
11b9847a33
1 changed files with 17 additions and 11 deletions
|
@ -6,7 +6,10 @@ class Pipedrive::PersonAdapter
|
|||
PIPEDRIVE_ROBOT_ID = '11381160'
|
||||
|
||||
def self.get_demandes_from_persons_owned_by_robot
|
||||
Pipedrive::API.get_persons_owned_by_user(PIPEDRIVE_ROBOT_ID).map do |datum|
|
||||
demandes = Pipedrive::API.get_persons_owned_by_user(PIPEDRIVE_ROBOT_ID)
|
||||
|
||||
if demandes.present?
|
||||
demandes.map do |datum|
|
||||
{
|
||||
person_id: datum['id'],
|
||||
nom: datum['name'],
|
||||
|
@ -18,6 +21,9 @@ class Pipedrive::PersonAdapter
|
|||
deadline: datum[PIPEDRIVE_DEADLINE_ATTRIBUTE_ID]
|
||||
}
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
def self.update_person_owner(person_id, owner_id)
|
||||
|
|
Loading…
Reference in a new issue