<?php
declare(strict_types=1);

namespace App\Modules\SportsActivity\Controllers;

use App\Core\Controller;
use App\Core\Request;
use App\Core\Response;
use App\Core\App;

class PoolGridController extends Controller
{
    public function index(Request $request): Response
    {
        return $this->redirect('/sa/mirror');
    }

    public function manage(Request $request, string $id): Response
    {
        $date = $request->get('date', '');
        $url = '/sa/mirror/pool/' . $id;
        if ($date !== '') {
            $url .= '?date=' . urlencode($date);
        }
        return $this->redirect($url);
    }
}
