<?php

use CodeIgniter\Router\RouteCollection;

/** @var RouteCollection $routes */

/* Rutas para tarifas */
$routes->group('catalogo', ['namespace' => 'App\Controllers\Catalogo'], function ($routes) {
    /* Libros */
    $routes->group('libros', ['namespace' => 'App\Controllers\Catalogo'], function ($routes) {
        /**======================
         *    CRUD
         *========================**/
        $routes->get('', 'CatalogoLibros::index', ['as' => 'catalogoLibrosList']);
        $routes->get('gettarifas', 'CatalogoLibros::getSelect2');
        $routes->match(['get', 'post'], 'add', 'CatalogoLibros::add', ['as' => 'catalogoLibrosAdd']);
        $routes->match(['get', 'post'], 'edit/(:num)', 'CatalogoLibros::edit/$1', ['as' => 'catalogoLibrosEdit']);
        $routes->get('delete/(:num)', 'CatalogoLibros::delete/$1', ['as' => 'catalogoLibrosDelete']);
        $routes->get('datatable', 'CatalogoLibros::datatable', ['as' => 'catalogoLibrosDT']);
        
        
        /**======================
         *    AJAX
         *========================**/
        $routes->get('clientlist', 'CatalogoLibros::getClientList', ['as' => 'catalogoLibrosClientList']);


    });
});