Notes / snooze, update data migration

- WIP on finishing out request list
This commit is contained in:
2024-06-22 20:23:37 -04:00
parent 3ebb03d470
commit 2369827033
11 changed files with 189 additions and 24 deletions

View 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();