<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->setAutoRoute('improved');

$routes->get('/', 'Admin\Login::getIndex');

$routes->get('admin/logout', 'Admin\Login::getLogout');

$routes->post('/push/save-subscription', 'Push::saveSubscription');
$routes->get('/push/send', 'Push::send'); // untuk trigger notifikasi manual

$routes->group('admin', ['filter' => 'noadmin'], static function ($routes) {
    $routes->get('', 'Admin\Login::getIndex');
    $routes->get('login', 'Admin\Login::getIndex');
    $routes->post('login', 'Admin\Login::postLogin');
    $routes->get('logout', 'Admin\Login::getLogout');
});
