1 | <?php |
2 | |
3 | require_once __DIR__ . "/../lib/php/ejecutaServicio.php"; |
4 | require_once __DIR__ . "/../lib/php/recuperaIdEntero.php"; |
5 | require_once __DIR__ . "/../lib/php/delete.php"; |
6 | require_once __DIR__ . "/../lib/php/devuelveNoContent.php"; |
7 | require_once __DIR__ . "/Bd.php"; |
8 | require_once __DIR__ . "/TABLA_USUARIO.php"; |
9 | require_once __DIR__ . "/TABLA_USU_ROL.php"; |
10 | |
11 | ejecutaServicio(function () { |
12 | |
13 | $usuId = recuperaIdEntero("id"); |
14 | |
15 | $pdo = Bd::pdo(); |
16 | $pdo->beginTransaction(); |
17 | |
18 | delete(pdo: $pdo, from: USU_ROL, where: [USU_ID => $usuId]); |
19 | delete(pdo: $pdo, from: USUARIO, where: [USU_ID => $usuId]); |
20 | |
21 | $pdo->commit(); |
22 | |
23 | devuelveNoContent(); |
24 | }); |
25 | |