- - Indie Stack - -
-- Check the README.md file for instructions on how to get this - project deployed. -
-- Check the README.md file for instructions on how to get this - project deployed. -
-{user.email}
- -No notes yet
- ) : ( -{data.note.body}
-- No note selected. Select a note on the left, or{" "} - - create a new note. - -
- ); -} diff --git a/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/notes/new.tsx b/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/notes/new.tsx deleted file mode 100644 index 8b856d66a35..00000000000 --- a/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/notes/new.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import * as React from "react"; -import { Form, json, redirect, useActionData } from "remix"; -import type { ActionFunction } from "remix"; -import Alert from "@reach/alert"; - -import { createNote } from "~/models/note.server"; -import { requireUserId } from "~/session.server"; - -type ActionData = { - errors?: { - title?: string; - body?: string; - }; -}; - -export const action: ActionFunction = async ({ request }) => { - const userId = await requireUserId(request); - - const formData = await request.formData(); - const title = formData.get("title"); - const body = formData.get("body"); - - if (typeof title !== "string" || title.length === 0) { - return json- - Create a New Post - -
- ); -} diff --git a/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/posts/admin/new.tsx b/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/posts/admin/new.tsx deleted file mode 100644 index 19ec4e353d2..00000000000 --- a/packages/remix-dev/__tests__/fixtures/replace-remix-magic-imports/app/routes/posts/admin/new.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import type { ActionFunction } from "@remix-run/node"; -import { redirect, json } from "@remix-run/node"; -import { Form, useActionData, useNavigation } from "@remix-run/react"; -import invariant from "tiny-invariant"; -import { createPost } from "~/models/post.server"; - -type ActionData = - | { title: null | string; slug: null | string; markdown: null | string } - | undefined; -export const action: ActionFunction = async ({ request }) => { - const formData = await request.formData(); - - const title = formData.get("title"); - const slug = formData.get("slug"); - const markdown = formData.get("markdown"); - - const errors: ActionData = { - title: title ? null : "Title is required", - slug: slug ? null : "Slug is required", - markdown: markdown ? null : "Markdown is required", - }; - const hasErrors = Object.values(errors).some((errorMessage) => errorMessage); - if (hasErrors) { - return json