set billing state from existing on edit

This commit is contained in:
keyan 2023-12-08 19:11:25 -06:00
parent 7fb31ab47e
commit e08fca15b6
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ export default function TerritoryForm ({ sub }) {
}, [client, upsertSub, router]
)
const [billing, setBilling] = useState('monthly')
const [billing, setBilling] = useState((sub?.billingType || 'MONTHLY').toLowerCase())
return (
<FeeButtonProvider baseLineItems={sub ? undefined : { territory: TERRITORY_BILLING_OPTIONS('first')[billing] }}>