Skip to content

Commit

Permalink
Update redirect URL in billing and storage.ostrich components
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmin-Parvulescu committed Feb 29, 2024
1 parent 7724a6f commit 3c9a218
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/console/app/routes/apps/$clientId/billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ export default () => {
isOpen={isCancelModalOpen}
setIsOpen={setIsCancelModalOpen}
clientID={appDetails.clientId!}
redirectURL={`/apps/${appDetails.clientId}/billing`}
redirectToAppBilling={true}
/>
)}
{isSubscriptionModalOpen && (
Expand Down
16 changes: 10 additions & 6 deletions apps/console/app/routes/apps/$clientId/storage.ostrich.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export const action: ActionFunction = getRollupReqFunctionErrorWrapper(
})
}

if (fd.get('redirect_url')) {
return redirect(fd.get('redirect_url') as string)
if (fd.get('redirect_to_app_billing')) {
return redirect(`/apps/${clientId}/billing`)
}

return null
Expand All @@ -240,12 +240,12 @@ export const ConfirmCancelModal = ({
isOpen,
setIsOpen,
clientID,
redirectURL,
redirectToAppBilling = false,
}: {
isOpen: boolean
setIsOpen: (val: boolean) => void
clientID: string
redirectURL?: string
redirectToAppBilling?: boolean
}) => {
const [confirmationText, setConfirmationText] = useState('')
const transition = useTransition()
Expand Down Expand Up @@ -283,8 +283,12 @@ export const ConfirmCancelModal = ({
}}
>
<input type="hidden" name="op" value="disable" />
{redirectURL && (
<input type="hidden" name="redirect_url" value={redirectURL} />
{redirectToAppBilling && (
<input
type="hidden"
name="redirect_to_app_billing"
value="true"
/>
)}

<section className="mb-4">
Expand Down

0 comments on commit 3c9a218

Please sign in to comment.