Remove time arg from addevent, date should contain both

This commit is contained in:
Skylar Ittner 2020-09-03 18:09:28 -06:00
parent 4e123691d5
commit 6958240e3d
2 changed files with 2 additions and 6 deletions

View File

@ -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(),

View File

@ -54,7 +54,6 @@ $APIS = [
"vars" => [
"id" => "/^[0-9a-z]+$/",
"date" => "string",
"time" => "string",
"event" => "string",
"publicnotes (optional)" => "string",
"privatenotes (optional)" => "string"