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) { if (empty($VARS["date"]) || (bool)strtotime($VARS["date"]) !== true) {
sendJsonResp("Invalid or missing event date.", "ERROR"); 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"])) { if (empty($VARS["event"])) {
sendJsonResp("Invalid or missing event type.", "ERROR"); sendJsonResp("Invalid or missing event type.", "ERROR");
} }
@ -37,7 +34,7 @@ $evt = Event::create(
$VARS['id'], $VARS['id'],
date( date(
"Y-m-d H:i:s", "Y-m-d H:i:s",
strtotime($VARS['date'] . " " . $VARS['time']) strtotime($VARS['date'])
), ),
$VARS['event'], $VARS['event'],
$user->getUID(), $user->getUID(),

View File

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