Skip to content

Commit b5e8bc6

Browse files
Fix missing import in /multiple-forms example (#467)
Co-authored-by: Mehdi Achour <[email protected]>
1 parent 92a17e8 commit b5e8bc6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

multiple-forms/app/data.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function writeInvitations(invitations: Array<Invitation>) {
2020
return fs.writeFile("./data.json", JSON.stringify({ invitations }, null, 2));
2121
}
2222

23-
export async function deleteInvitiation(invitation: Invitation) {
23+
export async function deleteInvitation(invitation: Invitation) {
2424
const invitations = await getInvitations();
2525
await writeInvitations(invitations.filter((i) => i.id !== invitation.id));
2626
}

multiple-forms/app/routes/invitations.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { json, redirect } from "@remix-run/node";
33
import { Form, useLoaderData } from "@remix-run/react";
44

55
import {
6+
deleteInvitation,
67
getInvitations,
78
resendInvitation,
89
sendInvitation,
@@ -30,8 +31,8 @@ export const action = async ({ request }: ActionArgs) => {
3031
// you'll want to handle this in a real app...
3132
throw new Error("make sure you implement validation");
3233
}
33-
const invitiations = await getInvitations();
34-
const invitation = invitiations.find((i) => i.id === invitationId);
34+
const invitations = await getInvitations();
35+
const invitation = invitations.find((i) => i.id === invitationId);
3536
if (!invitation) {
3637
// you'll want to handle this in a real app...
3738
throw new Error("make sure you implement validation");
@@ -42,7 +43,7 @@ export const action = async ({ request }: ActionArgs) => {
4243
return redirect(request.url);
4344
}
4445
if (formData.get("intent") === "delete") {
45-
await deleteInvitiation(invitation);
46+
await deleteInvitation(invitation);
4647
return redirect(request.url);
4748
}
4849
};

0 commit comments

Comments
 (0)