Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Stop client server mismatch errors
regalijan committed Dec 3, 2024
1 parent 3d316e5 commit f5ca483
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/routes/et-members_.strikes_.$uid.tsx
@@ -24,7 +24,7 @@ import {
} from "@chakra-ui/react";
import { LoaderFunctionArgs } from "@remix-run/cloudflare";
import { useLoaderData } from "@remix-run/react";
import { useState } from "react";
import { useEffect, useState } from "react";

export async function loader({
context,
@@ -60,11 +60,15 @@ export async function loader({

export default function () {
const { can_manage, strikes, user } = useLoaderData<typeof loader>();
const [strikeData, setStrikeData] = useState(strikes);
const [strikeData, setStrikeData] = useState([] as typeof strikes);
const toast = useToast();
const [rmStrikeId, setRmStrikeId] = useState("");
const [strikeReason, setStrikeReason] = useState("");

useEffect(() => {
setStrikeData(strikes);
}, []);

async function removeStrike(id: string) {
const removeResp = await fetch(`/api/events-team/strikes/${id}`, {
method: "DELETE",

0 comments on commit f5ca483

Please sign in to comment.