<?php
use ProVM\KI\Common\Controller\Web\Admin\Productos;

$app->group('/productos', function($app) {
  $app->group('/add', function($app) {
    $app->get('[/]', [Productos::class, 'add']);
    $app->post('[/]', [Productos::class, 'do_add']);
  });
  $app->post('/delete', [Productos::class, 'delete']);
  $app->get('[/]', Productos::class);
});
$app->group('/producto/{producto}', function($app) {
  $app->group('/imagen', function($app) {
    $app->post('/delete', [Productos::class, 'delete_image']);
  });
  $app->group('/imagenes', function($app) {
    $app->post('/add', [Productos::class, 'add_image']);
  });
  $app->group('/video', function($app) {
    $app->post('/set', [Productos::class, 'set_video']);
    $app->post('/delete', [Productos::class, 'delete_video']);
  });
  $app->post('[/]', [Productos::class, 'do_edit']);
  $app->get('[/]', [Productos::class, 'edit']);
});
