корзина кеш

This commit is contained in:
Alisa
2026-06-07 17:43:45 +03:00
parent 170bea76d5
commit 76bf5d8191
8 changed files with 530 additions and 15 deletions
+2
View File
@@ -3,6 +3,7 @@
declare(strict_types=1);
use App\Controllers\CatalogController;
use App\Controllers\CartController;
use App\Controllers\HomeController;
use App\Controllers\PageController;
use App\Controllers\PriceRequestController;
@@ -110,6 +111,7 @@ $catalogSearchHandler = static function (?string $rawQuery = null): void {
$router->get('/', static fn () => (new HomeController())->index());
$router->post('/price-request', static fn () => (new PriceRequestController())->store());
$router->post('/api/cart/sync', static fn () => (new CartController())->sync());
$router->get('/search', static fn () => $catalogSearchHandler());
$router->get('/search/{query}', static fn (string $query) => $catalogSearchHandler($query));
$router->get('/catalog', static fn () => trim((string) ($_GET['q'] ?? '')) !== '' ? $catalogSearchHandler() : (new CatalogController())->index());