Skip to content

Commit 1a115f1

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

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ import { notify } from 'src/application/notify';
88
import { ControlledInput } from 'src/components/controlled';
99
import { SectionHeader } from 'src/components/section-header';
1010
import { FormValues, handleSubmit } from 'src/hooks/form';
11+
import { useSearchParams } from 'src/hooks/router';
1112
import { createTranslate } from 'src/intl/translate';
1213

1314
const T = createTranslate('pages.organizationSettings.billing.coupon');
1415

1516
export function Coupon() {
17+
const params = useSearchParams();
1618
const organization = useOrganization();
1719
const t = T.useTranslate();
1820

1921
const form = useForm({
2022
defaultValues: {
21-
code: '',
23+
code: params.get('coupon') ?? '',
2224
},
2325
});
2426

0 commit comments

Comments
 (0)