From 6958240e3d50b0c4fc21781d3a5e212dbbd7681d Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Thu, 3 Sep 2020 18:09:28 -0600 Subject: [PATCH] Remove `time` arg from addevent, `date` should contain both --- api/actions/addevent.php | 5 +---- api/apisettings.php | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/api/actions/addevent.php b/api/actions/addevent.php index 5f3c3ca..1a75935 100644 --- a/api/actions/addevent.php +++ b/api/actions/addevent.php @@ -26,9 +26,6 @@ if (!$user->hasPermission("MACHINEMANAGER_EDIT") && !$user->hasPermission("MACHI if (empty($VARS["date"]) || (bool)strtotime($VARS["date"]) !== true) { sendJsonResp("Invalid or missing event date.", "ERROR"); } -if (empty($VARS["time"]) || (bool)strtotime($VARS["time"]) !== true) { - sendJsonResp("Invalid or missing event time.", "ERROR"); -} if (empty($VARS["event"])) { sendJsonResp("Invalid or missing event type.", "ERROR"); } @@ -37,7 +34,7 @@ $evt = Event::create( $VARS['id'], date( "Y-m-d H:i:s", - strtotime($VARS['date'] . " " . $VARS['time']) + strtotime($VARS['date']) ), $VARS['event'], $user->getUID(), diff --git a/api/apisettings.php b/api/apisettings.php index 5369313..8e1ddce 100644 --- a/api/apisettings.php +++ b/api/apisettings.php @@ -54,7 +54,6 @@ $APIS = [ "vars" => [ "id" => "/^[0-9a-z]+$/", "date" => "string", - "time" => "string", "event" => "string", "publicnotes (optional)" => "string", "privatenotes (optional)" => "string" @@ -63,7 +62,7 @@ $APIS = [ "geteventtypes" => [ "load" => "geteventtypes.php", "vars" => [ - + ] ] ];