Skip to content

Commit

Permalink
memo: 一旦諦めて元に戻しました
Browse files Browse the repository at this point in the history
  • Loading branch information
kensiiwasaki committed Dec 3, 2023
1 parent b53c96d commit a8327e8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/routes/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ export const action: ActionFunction = async ({ request }) => {

export default function List() {
const { tasks } = useLoaderData<typeof loader>();
// const fetcher = useFetcher();
const fetcher = useFetcher();

// const toggleTaskCompletion = async (taskId: number) => {
// const formData = new FormData();
// formData.append("taskId", String(taskId));
const toggleTaskCompletion = async (taskId: number) => {
const formData = new FormData();
formData.append("taskId", String(taskId));

// await fetcher.submit(formData, {
// method: "POST",
// });
// };
await fetcher.submit(formData, {
method: "POST",
});
};

return (
<div className="listContainer">
Expand All @@ -52,7 +52,7 @@ export default function List() {
<Form key={task.id} method="POST">
<p
className={task.completed ? "completed" : ""}
// onClick={() => toggleTaskCompletion(task.id)}
onClick={() => toggleTaskCompletion(task.id)}
>
{task.content}
</p>
Expand Down

0 comments on commit a8327e8

Please sign in to comment.