<?php

namespace Modules\Downloads\Config;

use Config;
// Create a new instance of our RouteCollection class.
$routes = Config\Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}


//setting up Inventory routes.
$routes->group('administrator/downloads', ['filter' => 'checkPermission', 'namespace' => 'Modules\Downloads\Controllers'],   static function($routes){

    $routes->get('/', 'Downloads::index');
    $routes->get('add', 'Downloads::addDownload');
    $routes->post('add', 'Downloads::addDownload');
    $routes->get('edit/(:any)', 'Downloads::editDownload/$1');
    $routes->post('update', 'Downloads::updateDownload');
    $routes->post('delete/(:any)', 'Downloads::delDownload/$1');

    $routes->get('categories', 'Downloads::downloadsCategories');
    $routes->post('categories/add', 'Downloads::addCategory');
    $routes->get('categories/edit/(:any)', 'Downloads::editCategory/$1');
    $routes->post('categories/update',  'Downloads::updateCategory');
    $routes->post('categories/delete/(:any)', 'Downloads::delCategory/$1');
});
