Skip to content

Commit

Permalink
use redirect method from react-router
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendphil committed Jan 21, 2025
1 parent 9088552 commit 4cc7635
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deployables/app/app/utils/editRoute.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type { ExecutionRoute } from '@zodiac/schema'
import { redirect } from 'react-router'

export const editRoute = (currentUrl: string, route: ExecutionRoute) => {
const url = new URL(currentUrl)

return Response.redirect(
new URL(`/edit-route/${btoa(JSON.stringify(route))}`, url.origin),
return redirect(
new URL(
`/edit-route/${btoa(JSON.stringify(route))}`,
url.origin,
).toString(),
)
}

0 comments on commit 4cc7635

Please sign in to comment.