From d87f44b75d6a4df62cea490c1d283c20e4031bc2 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 1 Sep 2025 21:06:48 +0800 Subject: [PATCH] fix(claims): handle single Offer object in fulfills field Updated extractOfferFulfillment to support both array and single object cases for the fulfills field. Previously only handled array format, now also checks if fulfills is a single Offer object with @type "Offer". --- src/views/ClaimView.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 3653861d..0214c438 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -739,13 +739,18 @@ export default class ClaimView extends Vue { } const fulfills = this.detailsForGive.fullClaim.fulfills; - if (!Array.isArray(fulfills)) { - this.detailsForGiveOfferFulfillment = 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.detailsForGiveOfferFulfillment = { offerHandleId: offerFulfill.identifier,