refactor(fe): New workspace actions route to avoid slug conflicts (#4107)
* Remove blockedSlugs * Update workspace action routes to use /actions * Re-add blockedWords
This commit is contained in:
committed by
GitHub
parent
7fbf3285b9
commit
c384996978
@@ -137,9 +137,9 @@ export const workspaceRoute = (slug: string) => `/workspaces/${slug}`
|
||||
export const workspaceSsoRoute = (slug: string) => `/workspaces/${slug}/sso`
|
||||
|
||||
export const workspaceCreateRoute = (slug?: string) =>
|
||||
slug ? `/workspaces/${slug}/create` : '/workspaces/create'
|
||||
slug ? `/workspaces/${slug}/create` : '/workspaces/actions/create'
|
||||
|
||||
export const workspaceJoinRoute = '/workspaces/join'
|
||||
export const workspaceJoinRoute = '/workspaces/actions/join'
|
||||
|
||||
export const workspaceFunctionsRoute = (slug: string) => `/workspaces/${slug}/functions`
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { convertThrowIntoFetchResult } from '~~/lib/common/helpers/graphql'
|
||||
import { workspaceCreateRoute, workspaceJoinRoute } from '~~/lib/common/helpers/route'
|
||||
|
||||
/**
|
||||
* Redirect user to /workspaces/join or /workspaces/create, if they have no workspaces
|
||||
* Redirect user to /workspaces/actions/join or /workspaces/actions/create, if they have no workspaces
|
||||
*/
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const isAuthPage = to.path.startsWith('/authn/')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { convertThrowIntoFetchResult } from '~~/lib/common/helpers/graphql'
|
||||
import { workspaceCreateRoute } from '~~/lib/common/helpers/route'
|
||||
|
||||
/**
|
||||
* Redirect user to /workspaces/create, if they have no discoverable workspaces
|
||||
* Redirect user to /workspaces/actions/create, if they have no discoverable workspaces
|
||||
*/
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const isWorkspacesEnabled = useIsWorkspacesEnabled()
|
||||
|
||||
@@ -69,7 +69,7 @@ export const createCheckoutSessionFactory =
|
||||
})
|
||||
|
||||
const cancel_url = isCreateFlow
|
||||
? `${frontendOrigin}/workspaces/create?workspaceId=${workspaceId}&payment_status=canceled&session_id={CHECKOUT_SESSION_ID}`
|
||||
? `${frontendOrigin}/workspaces/actions/create?workspaceId=${workspaceId}&payment_status=canceled&session_id={CHECKOUT_SESSION_ID}`
|
||||
: `${resultUrl.toString()}&payment_status=canceled&session_id={CHECKOUT_SESSION_ID}`
|
||||
|
||||
const session = await stripe.checkout.sessions.create({
|
||||
|
||||
@@ -421,4 +421,4 @@ export const blockedDomains: string[] = [
|
||||
'dontsendmespam.de'
|
||||
]
|
||||
|
||||
export const blockedSlugs: string[] = ['create', 'join']
|
||||
export const blockedSlugs: string[] = ['actions']
|
||||
|
||||
Reference in New Issue
Block a user