Files
ops-Gazelle/sections/ajax/clear_user_notification.php
2025-05-23 14:41:16 +02:00

16 lines
346 B
PHP

<?php
/** @phpstan-var \Gazelle\User $Viewer */
declare(strict_types=1);
namespace Gazelle;
$notifier = 'Gazelle\\User\\Notification\\' . $_POST['type'];
if (!class_exists($notifier)) {
json_die('failure', 'no such notification');
}
json_print('success', [
'clear' => (new $notifier($Viewer))->clear() /** @phpstan-ignore-line */
]);