fixed moodle logic
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user