Files
tinker_tickets/api/assign_ticket.php
T

24 lines
722 B
PHP
Raw Normal View History

2026-01-01 18:36:34 -05:00
<?php
require_once __DIR__ . '/bootstrap.php';
require_once dirname(__DIR__) . '/services/AssignmentService.php';
2026-01-01 18:36:34 -05:00
// Get request data
$data = json_decode(file_get_contents('php://input'), true);
if (!is_array($data)) {
http_response_code(400);
echo json_encode(['success' => false, 'error' => 'Invalid JSON body']);
exit;
}
// Validation, permission check, audit log, notification and stats-cache
// invalidation live in AssignmentService so the MCP assign_ticket tool runs
// the same code path.
$result = AssignmentService::assign($conn, $currentUser, $data);
2026-01-01 18:36:34 -05:00
if (!empty($result['http_status'])) {
http_response_code($result['http_status']);
unset($result['http_status']);
}
apiRespond($result);