Make rescheduler actually work kekw
This commit is contained in:
@ -355,8 +355,9 @@ export default function () {
|
||||
const newDate = (
|
||||
document.getElementById("reschedule-input") as HTMLInputElement
|
||||
).value;
|
||||
const day = newDate.split("-").at(2);
|
||||
const rescheduleResp = await fetch(`/api/events-team/events/${eventId}`, {
|
||||
body: JSON.stringify({ day: newDate.split("-").at(2) }),
|
||||
body: JSON.stringify({ day }),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
@ -379,6 +380,11 @@ export default function () {
|
||||
return;
|
||||
}
|
||||
|
||||
const newEventData = eventData;
|
||||
newEventData[eventData.findIndex((e) => e.id === eventId)].day = day;
|
||||
|
||||
setEventData([...newEventData]);
|
||||
setSelectedEvent("");
|
||||
onRescheduleClose();
|
||||
toast({
|
||||
description: `Event rescheduled to ${newDate}`,
|
||||
@ -527,7 +533,11 @@ export default function () {
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button onClick={onRescheduleClose}>Cancel</Button>
|
||||
<Button colorScheme="blue" ml="8px">
|
||||
<Button
|
||||
colorScheme="blue"
|
||||
ml="8px"
|
||||
onClick={async () => await reschedule(selectedEvent)}
|
||||
>
|
||||
Reschedule
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
|
Reference in New Issue
Block a user