<?php
declare(strict_types=1);
require_once __DIR__ . '/../../../Config/config.php';
require_once __DIR__ . '/../../../Config/functions.php';
require_once __DIR__ . '/../../../Controllers/NotificationsController.php';

require_login();
header('Content-Type: application/json');

$uid = (int)($_SESSION['user_id'] ?? 0);
$controller = new NotificationsController();
$ok = $controller->markRead($uid);

echo json_encode(['success'=>$ok]);
