diff --git a/services/client/common/methods/client/card.js b/services/client/common/methods/client/card.js index 752f7ce6a8..4bfc660056 100644 --- a/services/client/common/methods/client/card.js +++ b/services/client/common/methods/client/card.js @@ -36,10 +36,11 @@ module.exports = function(Client) { function formatCard(card) { let cardFormated = JSON.parse(JSON.stringify(card)); - cardFormated.salesPerson = { - id: card.salesPerson().id, - name: `${card.salesPerson().name} ${card.salesPerson().surname}` - }; + if(cardFormated.salesPersonFk) + cardFormated.salesPerson = { + id: card.salesPerson().id, + name: `${card.salesPerson().name} ${card.salesPerson().surname}` + }; return cardFormated; } };