20 lines
391 B
PHP
20 lines
391 B
PHP
<?php
|
|
require_once __DIR__ . '/../app/lib/auth.php';
|
|
require_once __DIR__ . '/../app/lib/transaction_service.php';
|
|
|
|
check_auth();
|
|
|
|
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
|
|
http_response_code(405);
|
|
exit('Method not allowed.');
|
|
}
|
|
|
|
$id = (int)($_POST['id'] ?? 0);
|
|
|
|
if ($id > 0) {
|
|
delete_transaction($id, user_id());
|
|
}
|
|
|
|
header('Location: /transactions.php');
|
|
exit;
|