Le formatting fixes

This commit is contained in:
2023-10-19 16:50:58 -04:00
parent 0a4ad7792d
commit 3155442796
11 changed files with 119 additions and 125 deletions

View File

@ -27,7 +27,7 @@ export default function (props: AppealCardProps) {
);
const [action, setAction] = useState("");
const [feedback, setFeedback] = useState("");
const [loading, setLoading] = useState(false)
const [loading, setLoading] = useState(false);
const toast = useToast();
useEffect(() => {
@ -42,7 +42,7 @@ export default function (props: AppealCardProps) {
}
async function takeAction(action: string) {
setLoading(true)
setLoading(true);
const actionReq = await fetch(`/api/appeals/${props.id}/${action}`, {
body: feedback ? JSON.stringify({ feedback }) : "{}",
headers: {
@ -52,7 +52,7 @@ export default function (props: AppealCardProps) {
});
if (actionReq.ok) {
setLoading(false)
setLoading(false);
toast({
description: `Appeal ${action === "accept" ? "accepted" : "denied"}`,
duration: 5000,
@ -62,7 +62,7 @@ export default function (props: AppealCardProps) {
document.getElementById(`appeal_${props.id}`)?.remove();
} else {
setLoading(false)
setLoading(false);
toast({
description: ((await actionReq.json()) as { error: string }).error,
duration: 10000,
@ -72,7 +72,7 @@ export default function (props: AppealCardProps) {
}
onClose();
setLoading(false)
setLoading(false);
}
return (
@ -92,7 +92,7 @@ export default function (props: AppealCardProps) {
<Button
onClick={async () => await takeAction(action.toLowerCase())}
isLoading={loading}
loadingText='Submitting...'
loadingText="Submitting..."
>
Submit
</Button>