Support asynchronous member table updates
This commit is contained in:
parent
97bba83eb5
commit
2f06159668
@ -12,6 +12,7 @@ import {
|
|||||||
Thead,
|
Thead,
|
||||||
Tr,
|
Tr,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export async function loader({ context }: { context: RequestContext }) {
|
export async function loader({ context }: { context: RequestContext }) {
|
||||||
if (!context.data.current_user)
|
if (!context.data.current_user)
|
||||||
@ -50,10 +51,11 @@ export default function () {
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
});
|
});
|
||||||
|
|
||||||
location.reload();
|
setMemberData(memberData.filter((member) => member.id !== id));
|
||||||
}
|
}
|
||||||
|
|
||||||
const memberData = useLoaderData<typeof loader>();
|
const [realtimePoints, setRealtimePoints] = useState(0);
|
||||||
|
const [memberData, setMemberData] = useState(useLoaderData<typeof loader>());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container maxW="container.lg">
|
<Container maxW="container.lg">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user