Skip to content

Commit cb2f5c9

Browse files
committed
import as data
1 parent b4d40b6 commit cb2f5c9

22 files changed

+51
-56
lines changed

app/root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
data as dataResponse,
2+
data,
33
type LoaderFunctionArgs,
44
type HeadersFunction,
55
type LinksFunction,
@@ -117,7 +117,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
117117
const { toast, headers: toastHeaders } = await getToast(request)
118118
const honeyProps = honeypot.getInputProps()
119119

120-
return dataResponse(
120+
return data(
121121
{
122122
user,
123123
requestInfo: {

app/routes/_auth+/forgot-password.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getZodConstraint, parseWithZod } from '@conform-to/zod'
33
import { type SEOHandle } from '@nasa-gcn/remix-seo'
44
import * as E from '@react-email/components'
55
import {
6-
data as dataResponse,
6+
data,
77
redirect,
88
type ActionFunctionArgs,
99
type MetaFunction,
@@ -54,7 +54,7 @@ export async function action({ request }: ActionFunctionArgs) {
5454
async: true,
5555
})
5656
if (submission.status !== 'success') {
57-
return dataResponse(
57+
return data(
5858
{ result: submission.reply() },
5959
{ status: submission.status === 'error' ? 400 : 200 },
6060
)
@@ -84,7 +84,7 @@ export async function action({ request }: ActionFunctionArgs) {
8484
if (response.status === 'success') {
8585
return redirect(redirectTo.toString())
8686
} else {
87-
return dataResponse(
87+
return data(
8888
{ result: submission.reply({ formErrors: [response.error.message] }) },
8989
{ status: 500 },
9090
)

app/routes/_auth+/login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getFormProps, getInputProps, useForm } from '@conform-to/react'
22
import { getZodConstraint, parseWithZod } from '@conform-to/zod'
33
import { type SEOHandle } from '@nasa-gcn/remix-seo'
44
import {
5-
data as dataResponse,
5+
data,
66
type ActionFunctionArgs,
77
type LoaderFunctionArgs,
88
type MetaFunction,
@@ -64,7 +64,7 @@ export async function action({ request }: ActionFunctionArgs) {
6464
})
6565

6666
if (submission.status !== 'success' || !submission.value.session) {
67-
return dataResponse(
67+
return data(
6868
{ result: submission.reply({ hideFields: ['password'] }) },
6969
{ status: submission.status === 'error' ? 400 : 200 },
7070
)

app/routes/_auth+/onboarding.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getFormProps, getInputProps, useForm } from '@conform-to/react'
22
import { getZodConstraint, parseWithZod } from '@conform-to/zod'
33
import {
4-
data as dataResponse,
4+
data,
55
redirect,
66
type LoaderFunctionArgs,
77
type ActionFunctionArgs,
@@ -93,7 +93,7 @@ export async function action({ request }: ActionFunctionArgs) {
9393
})
9494

9595
if (submission.status !== 'success' || !submission.value.session) {
96-
return dataResponse(
96+
return data(
9797
{ result: submission.reply() },
9898
{ status: submission.status === 'error' ? 400 : 200 },
9999
)

app/routes/_auth+/onboarding_.$provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import { getZodConstraint, parseWithZod } from '@conform-to/zod'
88
import {
99
redirect,
10-
data as dataResponse,
10+
data,
1111
type ActionFunctionArgs,
1212
type LoaderFunctionArgs,
1313
type MetaFunction,
@@ -143,7 +143,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
143143
})
144144

145145
if (submission.status !== 'success') {
146-
return dataResponse(
146+
return data(
147147
{ result: submission.reply() },
148148
{ status: submission.status === 'error' ? 400 : 200 },
149149
)

app/routes/_auth+/reset-password.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { invariant } from '@epic-web/invariant'
2-
import { data as dataResponse, redirect } from '@remix-run/node'
2+
import { data, redirect } from '@remix-run/node'
33
import { prisma } from '#app/utils/db.server.ts'
44
import { verifySessionStorage } from '#app/utils/verification.server.ts'
55
import { resetPasswordUsernameSessionKey } from './reset-password.tsx'
@@ -18,7 +18,7 @@ export async function handleVerification({ submission }: VerifyFunctionArgs) {
1818
// we don't want to say the user is not found if the email is not found
1919
// because that would allow an attacker to check if an email is registered
2020
if (!user) {
21-
return dataResponse(
21+
return data(
2222
{ result: submission.reply({ fieldErrors: { code: ['Invalid code'] } }) },
2323
{ status: 400 },
2424
)

app/routes/_auth+/reset-password.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getFormProps, getInputProps, useForm } from '@conform-to/react'
22
import { getZodConstraint, parseWithZod } from '@conform-to/zod'
33
import { type SEOHandle } from '@nasa-gcn/remix-seo'
44
import {
5-
data as dataResponse,
5+
data,
66
redirect,
77
type ActionFunctionArgs,
88
type LoaderFunctionArgs,
@@ -51,7 +51,7 @@ export async function action({ request }: ActionFunctionArgs) {
5151
schema: ResetPasswordSchema,
5252
})
5353
if (submission.status !== 'success') {
54-
return dataResponse(
54+
return data(
5555
{ result: submission.reply() },
5656
{ status: submission.status === 'error' ? 400 : 200 },
5757
)

app/routes/_auth+/signup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getZodConstraint, parseWithZod } from '@conform-to/zod'
33
import { type SEOHandle } from '@nasa-gcn/remix-seo'
44
import * as E from '@react-email/components'
55
import {
6-
data as dataResponse,
6+
data,
77
redirect,
88
type ActionFunctionArgs,
99
type MetaFunction,
@@ -56,7 +56,7 @@ export async function action({ request }: ActionFunctionArgs) {
5656
async: true,
5757
})
5858
if (submission.status !== 'success') {
59-
return dataResponse(
59+
return data(
6060
{ result: submission.reply() },
6161
{ status: submission.status === 'error' ? 400 : 200 },
6262
)
@@ -78,7 +78,7 @@ export async function action({ request }: ActionFunctionArgs) {
7878
if (response.status === 'success') {
7979
return redirect(redirectTo.toString())
8080
} else {
81-
return dataResponse(
81+
return data(
8282
{
8383
result: submission.reply({ formErrors: [response.error.message] }),
8484
},

app/routes/_auth+/verify.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type Submission } from '@conform-to/react'
22
import { parseWithZod } from '@conform-to/zod'
3-
import { data as dataResponse } from '@remix-run/node'
3+
import { data } from '@remix-run/node'
44
import { z } from 'zod'
55
import { handleVerification as handleChangeEmailVerification } from '#app/routes/settings+/profile.change-email.server.tsx'
66
import { twoFAVerificationType } from '#app/routes/settings+/profile.two-factor.tsx'
@@ -161,7 +161,7 @@ export async function validateRequest(
161161
})
162162

163163
if (submission.status !== 'success') {
164-
return dataResponse(
164+
return data(
165165
{ result: submission.reply() },
166166
{ status: submission.status === 'error' ? 400 : 200 },
167167
)

app/routes/resources+/theme-switch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useForm, getFormProps } from '@conform-to/react'
22
import { parseWithZod } from '@conform-to/zod'
33
import { invariantResponse } from '@epic-web/invariant'
4-
import { data as dataResponse, type ActionFunctionArgs } from '@remix-run/node'
4+
import { data, type ActionFunctionArgs } from '@remix-run/node'
55
import { redirect, useFetcher, useFetchers } from '@remix-run/react'
66
import { ServerOnly } from 'remix-utils/server-only'
77
import { z } from 'zod'
@@ -32,7 +32,7 @@ export async function action({ request }: ActionFunctionArgs) {
3232
if (redirectTo) {
3333
return redirect(redirectTo, responseInit)
3434
} else {
35-
return dataResponse({ result: submission.reply() }, responseInit)
35+
return data({ result: submission.reply() }, responseInit)
3636
}
3737
}
3838

0 commit comments

Comments
 (0)