Notes / snooze, update data migration
- WIP on finishing out request list
This commit is contained in:
21
src/public/request/snooze.php
Normal file
21
src/public/request/snooze.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use MyPrayerJournal\{Auth, Request, Table, UI};
|
||||
use BitBadger\PDODocument\Patch;
|
||||
|
||||
require '../../start.php';
|
||||
if ($_SERVER['REQUEST_METHOD'] <> 'PATCH') not_found();
|
||||
|
||||
Auth::requireUser(false);
|
||||
|
||||
$req = Request::byId($_GET['id']);
|
||||
if (!$req) not_found();
|
||||
|
||||
$until = (new DateTimeImmutable($_PATCH['until'] . 'T00:00:00', new DateTimeZone($_REQUEST['time_zone'])))
|
||||
->setTimezone(new DateTimeZone('Etc/UTC'));
|
||||
Patch::byId(Table::REQUEST, $req->id, ['snoozedUntil' => $until->format('c')]);
|
||||
|
||||
// TODO: message
|
||||
|
||||
hide_modal('snooze');
|
||||
UI::journal();
|
||||
Reference in New Issue
Block a user