Skip to content

Commit ee65ae5

Browse files
committed
allow specifying a coupon code in billing page's query parameters
1 parent 3a2a92d commit ee65ae5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pages/settings/organization/billing/coupon.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import { notify } from 'src/application/notify';
66
import { ControlledInput } from 'src/components/controlled';
77
import { SectionHeader } from 'src/components/section-header';
88
import { handleSubmit } from 'src/hooks/form';
9+
import { useSearchParams } from 'src/hooks/router';
910
import { createTranslate, Translate } from 'src/intl/translate';
1011

1112
const T = createTranslate('pages.organizationSettings.billing.coupon');
1213

1314
export function Coupon() {
15+
const params = useSearchParams();
1416
const organization = useOrganization();
1517
const t = T.useTranslate();
1618

1719
const form = useForm({
1820
defaultValues: {
19-
coupon: '',
21+
coupon: params.get('coupon') ?? '',
2022
},
2123
});
2224

0 commit comments

Comments
 (0)