From 3e5e2cd0bbaa03863335ca15ce1996e18e0cc2f2 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 1 Sep 2025 21:18:08 +0800 Subject: [PATCH] fix(claims): handle single Offer object in fulfills field for ConfirmGiftView Updated extractOfferFulfillment to support both array and single object cases for the fulfills field, matching the fix applied to ClaimView. Now handles when fulfills contains a single Offer object with @type "Offer". --- src/views/ConfirmGiftView.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/ConfirmGiftView.vue b/src/views/ConfirmGiftView.vue index 6fa5428a..93832640 100644 --- a/src/views/ConfirmGiftView.vue +++ b/src/views/ConfirmGiftView.vue @@ -724,13 +724,18 @@ export default class ConfirmGiftView extends Vue { } const fulfills = this.giveDetails.fullClaim.fulfills; - if (!Array.isArray(fulfills)) { - this.giveDetailsOfferFulfillment = null; - return; + + // Handle both array and single object cases + let offerFulfill = null; + + if (Array.isArray(fulfills)) { + // Find the Offer in the fulfills array + offerFulfill = fulfills.find((item) => item["@type"] === "Offer"); + } else if (fulfills["@type"] === "Offer") { + // fulfills is a single Offer object + offerFulfill = fulfills; } - - // Find the Offer in the fulfills array - const offerFulfill = fulfills.find((item) => item["@type"] === "Offer"); + if (offerFulfill) { this.giveDetailsOfferFulfillment = { offerHandleId: offerFulfill.identifier,