Created extractOfferFulfillment utility in libs/util.ts to handle both
array and single object cases for fulfills field. Updated ClaimView and
ConfirmGiftView to use the shared utility, eliminating code duplication
and improving maintainability.
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".
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".
- capitalizeAndInsertSpacesBeforeCapsWithAPrefix() defined in two places, unified and moved to endorserServer.ts
- Use capitalizeAndInsertSpacesBeforeCaps() that's already defined in endorserServer.ts
- Remove outdated fulfillsType logic that was checking for non-PlanAction items
- Keep only the new offer fulfillment extraction from fullClaim.fulfills array
- Apply consistent changes to both ClaimView and ConfirmGiftView
This ensures that "Fulfills Offer..." links appear correctly when gives are created from offers, by directly parsing the fulfills array instead of relying on API-processed fields that only capture the first relationship.