fixed moodle logic

This commit is contained in:
PxlLoewe
2025-06-26 13:40:33 -07:00
parent 8968bff1c5
commit 22a406c2d1
13 changed files with 127 additions and 95 deletions

View File

@@ -62,15 +62,6 @@ export const AppointmentModal = ({
timeCaption="Uhrzeit"
showTimeCaption
/>
{/* <Input
form={appointmentForm}
type="datetime-local"
label="Datum"
name="appointmentDate"
formOptions={{
valueAsDate: true,
}}
/> */}
<div>
<PaginatedTable
hide={appointmentForm.watch("id") === undefined}

View File

@@ -55,23 +55,28 @@ export const ParticipantModal = ({ participantForm, ref }: ParticipantModalProps
<Button
className="btn-sm"
onClick={async () => {
if (!participantForm.watch("id")) return;
try {
if (!participantForm.watch("id")) return;
const participant = participantForm.getValues();
await handleParticipantFinished(participant.id.toString()).catch((e) => {
const error = e as AxiosError;
const participant = participantForm.getValues();
await handleParticipantFinished(participant.id.toString()).catch((e) => {
const error = e as AxiosError;
});
toast.success("Workflow erfolgreich ausgeführt");
router.refresh();
} catch (error) {
const e = error as AxiosError;
if (
error.response?.data &&
typeof error.response.data === "object" &&
"error" in error.response.data
e.response?.data &&
typeof e.response.data === "object" &&
"error" in e.response.data
) {
toast.error(`Fehler: ${error.response.data.error}`);
toast.error(`Fehler: ${e.response.data.error}`);
} else {
toast.error("Unbekannter Fehler beim ausführen des Workflows");
}
});
toast.success("Workflow erfolgreich ausgeführt");
router.refresh();
}
}}
>
Event-abgeschlossen Workflow ausführen