File tree Expand file tree Collapse file tree 5 files changed +11
-8
lines changed
file-and-cloudinary-upload/app/utils Expand file tree Collapse file tree 5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1- import { DataFunctionArgs } from "@remix-run/node" ;
1+ import type { DataFunctionArgs } from "@remix-run/node" ;
22import DataLoader from "dataloader" ;
33
44import { db } from "~/data.server" ;
Original file line number Diff line number Diff line change 11import { json } from "@remix-run/node" ;
22import { Outlet , useLoaderData } from "@remix-run/react" ;
3- import { User } from "~/data.server" ;
4- import { DataLoaderArgs } from "~/loaders/userLoader" ;
3+
4+ import type { User } from "~/data.server" ;
5+ import type { DataLoaderArgs } from "~/loaders/userLoader" ;
56
67export const loader = async ( { context } : DataLoaderArgs ) => {
78 const users = await context . loaders . usersById . loadMany ( [
Original file line number Diff line number Diff line change 11import { json } from "@remix-run/node" ;
22import { useLoaderData } from "@remix-run/react" ;
3- import { DataLoaderArgs } from "~/loaders/userLoader" ;
3+
4+ import type { DataLoaderArgs } from "~/loaders/userLoader" ;
45
56export const loader = async ( { context } : DataLoaderArgs ) => {
67 /*
Original file line number Diff line number Diff line change 1- import cloudinary , { UploadApiResponse } from "cloudinary" ;
1+ import type { UploadApiResponse } from "cloudinary" ;
2+ import cloudinary from "cloudinary" ;
23import { writeAsyncIterableToWritable } from "@remix-run/node" ;
34
45cloudinary . v2 . config ( {
Original file line number Diff line number Diff line change @@ -126,13 +126,13 @@ export const action = async ({ request }: ActionArgs) => {
126126
127127export default function Register ( ) {
128128 const actionData = useActionData < typeof action > ( ) ;
129- let fieldErrors =
129+ const fieldErrors =
130130 actionData && "fieldErrors" in actionData
131131 ? actionData . fieldErrors
132132 : undefined ;
133- let formError =
133+ const formError =
134134 actionData && "formError" in actionData ? actionData . formError : undefined ;
135- let fields =
135+ const fields =
136136 actionData && "fields" in actionData ? actionData . fields : undefined ;
137137 const [ searchParams ] = useSearchParams ( ) ;
138138
You can’t perform that action at this time.
0 commit comments