@@ -17,6 +17,7 @@ export enum VariableItems {
1717 RE_SIGNUP = 'I want to sign up for a new account using a marketplace option' ,
1818 OTHER_REASON = 'Other reason' ,
1919}
20+
2021export interface DeleteOrgContextType {
2122 shortSuggestion : string
2223 isShortSuggestionEnabled : boolean
@@ -26,6 +27,7 @@ export interface DeleteOrgContextType {
2627 setSuggestions : ( _ : string ) => void
2728 reason : string
2829 setReason : ( _ : string ) => void
30+ getRedirectLocation : ( ) => string
2931}
3032
3133export const DEFAULT_DELETE_ORG_CONTEXT : DeleteOrgContextType = {
@@ -37,7 +39,14 @@ export const DEFAULT_DELETE_ORG_CONTEXT: DeleteOrgContextType = {
3739 setSuggestions : ( _ : string ) => null ,
3840 reason : 'NO_OPTION' ,
3941 setReason : ( _ : string ) => null ,
42+ getRedirectLocation : ( ) => DEFAULT_REDIRECT_LOCATION ,
43+ }
44+
45+ const RedirectLocations = {
46+ SWITCHING_ORGANIZATION : '/org_cancel' ,
47+ RE_SIGNUP : '/cancel' ,
4048}
49+ const DEFAULT_REDIRECT_LOCATION = '/mkt_cancel'
4150
4251export const DeleteOrgContext = createContext < DeleteOrgContextType > (
4352 DEFAULT_DELETE_ORG_CONTEXT
@@ -55,6 +64,12 @@ const DeleteOrgProvider: FC<Props> = ({children}) => {
5564 )
5665 const [ reason , setReason ] = useState ( DEFAULT_DELETE_ORG_CONTEXT . reason )
5766
67+ const getRedirectLocation = ( ) => {
68+ const uri = RedirectLocations [ reason ] ?? '/mkt_cancel'
69+
70+ return `https://www.influxdata.com${ uri } `
71+ }
72+
5873 return (
5974 < DeleteOrgContext . Provider
6075 value = { {
@@ -66,6 +81,7 @@ const DeleteOrgProvider: FC<Props> = ({children}) => {
6681 setSuggestions,
6782 reason,
6883 setReason,
84+ getRedirectLocation,
6985 } }
7086 >
7187 { children }
0 commit comments