Compare commits
2 Commits
6d8238f394
...
3d8ce8356f
Author | SHA1 | Date | |
---|---|---|---|
3d8ce8356f | |||
8c32cd121d |
@ -348,7 +348,18 @@ export default function () {
|
|||||||
const newDate = (
|
const newDate = (
|
||||||
document.getElementById("reschedule-input") as HTMLInputElement
|
document.getElementById("reschedule-input") as HTMLInputElement
|
||||||
).value;
|
).value;
|
||||||
const day = newDate.split("-").at(2);
|
const day = parseInt(newDate.split("-").at(2) ?? "");
|
||||||
|
|
||||||
|
if (isNaN(day)) {
|
||||||
|
toast({
|
||||||
|
description: "Please select a date, then try again.",
|
||||||
|
status: "error",
|
||||||
|
title: "No date selected",
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const rescheduleResp = await fetch(`/api/events-team/events/${eventId}`, {
|
const rescheduleResp = await fetch(`/api/events-team/events/${eventId}`, {
|
||||||
body: JSON.stringify({ day }),
|
body: JSON.stringify({ day }),
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -271,7 +271,7 @@ async function setAuth(context: RequestContext) {
|
|||||||
|
|
||||||
async function setBody(context: RequestContext) {
|
async function setBody(context: RequestContext) {
|
||||||
if (
|
if (
|
||||||
context.request.method === "POST" &&
|
["PATCH", "POST", "PUT"].includes(context.request.method) &&
|
||||||
!context.request.url.endsWith("/api/infractions/new")
|
!context.request.url.endsWith("/api/infractions/new")
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user