File tree 5 files changed +11
-8
lines changed
file-and-cloudinary-upload/app/utils
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" ;
2
2
import DataLoader from "dataloader" ;
3
3
4
4
import { db } from "~/data.server" ;
Original file line number Diff line number Diff line change 1
1
import { json } from "@remix-run/node" ;
2
2
import { 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" ;
5
6
6
7
export const loader = async ( { context } : DataLoaderArgs ) => {
7
8
const users = await context . loaders . usersById . loadMany ( [
Original file line number Diff line number Diff line change 1
1
import { json } from "@remix-run/node" ;
2
2
import { useLoaderData } from "@remix-run/react" ;
3
- import { DataLoaderArgs } from "~/loaders/userLoader" ;
3
+
4
+ import type { DataLoaderArgs } from "~/loaders/userLoader" ;
4
5
5
6
export const loader = async ( { context } : DataLoaderArgs ) => {
6
7
/*
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" ;
2
3
import { writeAsyncIterableToWritable } from "@remix-run/node" ;
3
4
4
5
cloudinary . v2 . config ( {
Original file line number Diff line number Diff line change @@ -126,13 +126,13 @@ export const action = async ({ request }: ActionArgs) => {
126
126
127
127
export default function Register ( ) {
128
128
const actionData = useActionData < typeof action > ( ) ;
129
- let fieldErrors =
129
+ const fieldErrors =
130
130
actionData && "fieldErrors" in actionData
131
131
? actionData . fieldErrors
132
132
: undefined ;
133
- let formError =
133
+ const formError =
134
134
actionData && "formError" in actionData ? actionData . formError : undefined ;
135
- let fields =
135
+ const fields =
136
136
actionData && "fields" in actionData ? actionData . fields : undefined ;
137
137
const [ searchParams ] = useSearchParams ( ) ;
138
138
You can’t perform that action at this time.
0 commit comments