|
1 | 1 | import { getFormProps, getInputProps, useForm } from "@conform-to/react"; |
2 | 2 | import { parseWithZod } from "@conform-to/zod"; |
3 | 3 | import { CommandLineIcon, FolderIcon } from "@heroicons/react/20/solid"; |
4 | | -import { json, type ActionFunction, type LoaderFunctionArgs } from "@remix-run/node"; |
| 4 | +import { |
| 5 | + json, |
| 6 | + redirectDocument, |
| 7 | + type ActionFunction, |
| 8 | + type LoaderFunctionArgs, |
| 9 | +} from "@remix-run/node"; |
5 | 10 | import { Form, useActionData, useNavigation } from "@remix-run/react"; |
6 | 11 | import type { Prisma } from "@trigger.dev/database"; |
7 | 12 | import React, { useEffect, useState } from "react"; |
8 | | -import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson"; |
| 13 | +import { typedjson, useTypedLoaderData } from "remix-typedjson"; |
9 | 14 | import invariant from "tiny-invariant"; |
10 | 15 | import { z } from "zod"; |
11 | 16 | import { BackgroundWrapper } from "~/components/BackgroundWrapper"; |
@@ -285,14 +290,17 @@ export const action: ActionFunction = async ({ request, params }) => { |
285 | 290 | if (next) { |
286 | 291 | params.set("next", next); |
287 | 292 | } |
288 | | - return redirect(`/vercel/connect?${params.toString()}`); |
| 293 | + return redirectDocument(`/vercel/connect?${params.toString()}`); |
289 | 294 | } |
290 | 295 |
|
291 | | - return redirectWithSuccessMessage( |
292 | | - v3ProjectPath(project.organization, project), |
| 296 | + const destination = v3ProjectPath(project.organization, project); |
| 297 | + const response = await redirectWithSuccessMessage( |
| 298 | + destination, |
293 | 299 | request, |
294 | 300 | `${submission.value.projectName} created` |
295 | 301 | ); |
| 302 | + |
| 303 | + return redirectDocument(destination, { headers: response.headers }); |
296 | 304 | } catch (error) { |
297 | 305 | if (error instanceof ExceededProjectLimitError) { |
298 | 306 | return redirectWithErrorMessage( |
|
0 commit comments