diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx index 853ec7812..4b89f459b 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx @@ -32,7 +32,6 @@ const GiftCardUpdateInfoCardContent: React.FC = () => { createdBy, usedByEmail, usedBy, - app, product, events } = giftCard; @@ -48,12 +47,22 @@ const GiftCardUpdateInfoCardContent: React.FC = () => { // createdBy can be either customer or staff hence // we check for issued event if (cardIssuedEvent) { + const { app } = cardIssuedEvent; + + if (app) { + return { + label: messages.issuedByAppLabel, + name: app?.name, + url: appUrl(app?.id) + }; + } + const userName = getFullName(createdBy); return { label: messages.issuedByLabel, name: userName || createdByEmail, - url: staffMemberDetailsUrl(createdBy.id) + url: staffMemberDetailsUrl(createdBy?.id) }; } @@ -64,14 +73,6 @@ const GiftCardUpdateInfoCardContent: React.FC = () => { }; } - if (app) { - return { - label: messages.issuedByAppLabel, - name: app.name, - url: appUrl(app.id) - }; - } - return { label: messages.boughtByLabel, name: getFullName(createdBy),