Remove `time` arg from addevent, `date` should contain both

master
Skylar Ittner 4 years ago
parent 4e123691d5
commit 6958240e3d

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

@ -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" => [
]
]
];

Loading…
Cancel
Save