<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */

// Pages
$routes->get('/', 'Pages::dashboard_index');
$routes->get('/userroles/', 'Pages::userroles_index');
$routes->get('/users/', 'Pages::users_index');
$routes->get('/changePass/', 'Pages::changePass');
$routes->get('/dictTests/', 'Pages::dictTests_index');

// Tubes
$routes->get('/tubes/collect/(:any)/(:any)', 'Tubes::collect/$1/$2');
$routes->get('/tubes/collectAll/(:any)', 'Tubes::collectAll/$1');
$routes->get('/tubes/uncollect/(:any)/(:any)', 'Tubes::uncollect/$1/$2');
$routes->get('/tubes/uncollectAll/(:any)', 'Tubes::uncollectAll/$1');
$routes->get('/tubes/unreceive/(:any)/(:any)', 'Tubes::unreceive/$1/$2');
$routes->get('/tubes/unreceiveAll/(:any)', 'Tubes::unreceiveAll/$1');
$routes->post('/tubes/comment/(:any)/(:any)', 'Tubes::comment/$1/$2');

$routes->get('/dashboard/viewAccess/(:any)', 'Dashboard::viewAccess/$1');
// Dashboard
$routes->get('/api/dashboard/index', 'Dashboard::index');

// DICT_TESTS
$routes->get('/dict_tests/', 'Dict_tests::index');

// Auth
$routes->get('/auth/logout', 'Auth::logout');
$routes->get('/auth/loginTD', 'Auth::loginTD');
$routes->match(['get','post'], '/auth/login', 'Auth::login');
$routes->match(['get','post'], '/auth/setpass/(:any)', 'Auth::setpass/$1');

// API - Userroles
$routes->get('/api/userroles/index', 'Userroles::index');
$routes->get('/api/userroles/detail/(:any)', 'Userroles::detail/$1');
$routes->post('/api/userroles/save/(:any)', 'Userroles::save/$1');

// API - Users
$routes->get('/api/users/index', 'Users::index');
$routes->get('/api/users/detail/(:any)', 'Users::detail/$1');
$routes->post('/api/users/savePass/(:any)', 'Users::savePass/$1');
$routes->post('/api/users/saveRole/(:any)', 'Users::saveRole/$1');

// API - DictTests
$routes->get('/api/dictTests/index', 'DictTests::index');
