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

@ -18,7 +18,7 @@ import { useState } from "react";
export default function (props: ReportCardProps) {
const [attachmentIdx, setAttachmentIdx] = useState(0);
const [loading, setLoading] = useState(false)
const [loading, setLoading] = useState(false);
const toast = useToast();
const targetMap: { [k: number]: string } = {};
const [attachmentsReady, setAttachmentReady] = useState(
@ -44,7 +44,7 @@ export default function (props: ReportCardProps) {
}
async function submitActions() {
setLoading(true)
setLoading(true);
const submitReq = await fetch(`/api/reports/${props.id}/action`, {
body: JSON.stringify(actionMap),
headers: {
@ -54,7 +54,7 @@ export default function (props: ReportCardProps) {
});
if (!submitReq.ok) {
setLoading(false)
setLoading(false);
toast({
description: ((await submitReq.json()) as { error: string }).error,
status: "error",
@ -69,7 +69,7 @@ export default function (props: ReportCardProps) {
status: "success",
title: "Success",
});
setLoading(false)
setLoading(false);
}
return (
@ -192,7 +192,7 @@ export default function (props: ReportCardProps) {
colorScheme="blue"
onClick={async () => await submitActions()}
isLoading={loading}
loadingText='Submitting...'
loadingText="Submitting..."
>
Submit
</Button>