mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Update api scheduled to use current datetime by default
This commit is contained in:
parent
379eaa2786
commit
6c6082ca90
2 changed files with 9 additions and 2 deletions
|
@ -182,7 +182,7 @@ namespace controllers\publics;
|
|||
*
|
||||
* @return : Id of scheduled created
|
||||
*/
|
||||
public function post_scheduled()
|
||||
public function post_scheduled ()
|
||||
{
|
||||
$at = $_POST['at'] ?? false;
|
||||
$text = $_POST['text'] ?? false;
|
||||
|
@ -193,6 +193,11 @@ namespace controllers\publics;
|
|||
$groups = $_POST['groups'] ?? [];
|
||||
$conditional_groups = $_POST['conditional_groups'] ?? [];
|
||||
|
||||
if (!$at)
|
||||
{
|
||||
$at = (new \DateTime())->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
if (!$at || !$text)
|
||||
{
|
||||
$return = self::DEFAULT_RETURN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue