diff --git a/apps/admin-x-settings/src/api/offers.ts b/apps/admin-x-settings/src/api/offers.ts index 7aba3330de..074dcf24d2 100644 --- a/apps/admin-x-settings/src/api/offers.ts +++ b/apps/admin-x-settings/src/api/offers.ts @@ -1,4 +1,4 @@ -import {Meta, createQuery} from '../utils/api/hooks'; +import {Meta, createQuery, createQueryWithId} from '../utils/api/hooks'; export type Offer = { id: string; @@ -32,3 +32,8 @@ export const useBrowseOffers = createQuery({ dataType, path: '/offers/' }); + +export const useBrowseOffersById = createQueryWithId({ + dataType, + path: `/offers/` +}); diff --git a/apps/admin-x-settings/src/components/settings/membership/offers/EditOfferModal.tsx b/apps/admin-x-settings/src/components/settings/membership/offers/EditOfferModal.tsx index d216b19932..9fd19aa7e0 100644 --- a/apps/admin-x-settings/src/components/settings/membership/offers/EditOfferModal.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/offers/EditOfferModal.tsx @@ -5,10 +5,13 @@ import TextArea from '../../../../admin-x-ds/global/form/TextArea'; import TextField from '../../../../admin-x-ds/global/form/TextField'; import useFeatureFlag from '../../../../hooks/useFeatureFlag'; import useRouting from '../../../../hooks/useRouting'; +import {Offer} from '../../../../api/offers'; import {PreviewModalContent} from '../../../../admin-x-ds/global/modal/PreviewModal'; +import {RoutingModalProps} from '../../../providers/RoutingProvider'; +import {useBrowseOffersById} from '../../../../api/offers'; import {useEffect} from 'react'; -const Sidebar: React.FC = () => { +const Sidebar: React.FC<{offer: Offer}> = ({offer}) => { return (
@@ -16,7 +19,7 @@ const Sidebar: React.FC = () => { hint='Visible to members on Stripe Checkout page.' placeholder='Black Friday' title='Name' - value='Black friday' + value={offer?.name} />

Portal Settings

@@ -24,24 +27,24 @@ const Sidebar: React.FC = () => {