Fixed Offers redemptions preselection (#19541)

fixes
https://linear.app/tryghost/issue/PROD-319/offer-is-not-preselected-in-filter-dropdown-after-navigating-to

- fixes the URL builder for when Redeemed offers are selected to ensure
the selected tier is preselected in the members filter
This commit is contained in:
Ronald Langeveld 2024-01-22 15:14:08 +00:00 committed by GitHub
parent d37a46a400
commit dc1bba781b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,8 @@ export type OfferType = 'percent' | 'fixed' | 'trial';
export const createRedemptionFilterUrl = (id: string): string => {
const baseHref = '/ghost/#/members';
return `${baseHref}?filter=${encodeURIComponent('offer_redemptions:' + id)}`;
const filterValue = `offer_redemptions:[${id}]`;
return `${baseHref}?filter=${encodeURIComponent(filterValue)}`;
};
export const getOfferCadence = (cadence: string): string => {

View File

@ -92,7 +92,7 @@
<span class="midgrey strike ml2">{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{/if}}
</LinkTo>
<LinkTo @route="members" @query={{hash filter=(concat "offer_redemptions:" offer.id)}} class="gh-list-data" data-test-list="redemption-count">
<LinkTo @route="members" @query={{hash filter=(concat "offer_redemptions:[" offer.id "]")}} class="gh-list-data" data-test-list="redemption-count">
<span class="midgrey">{{offer.redemptionCount}}</span>
</LinkTo>
<div class="gh-list-data gh-list-cellwidth-10 gh-list-chevron">