feat(bugtracker, tokens): Add project search, push_id, target_agent, tags, edit modal, extended severities (idea, wishlist), token actions (copy/toggle/delete), and agent integration guide
This commit is contained in:
@@ -157,6 +157,35 @@ try {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'update' || str_contains($path, '/update')) {
|
||||
if ($method !== 'POST') {
|
||||
http_response_code(405);
|
||||
echo json_encode(['status' => 'error', 'message' => 'POST required for update']);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$itemId && !empty($input['id'])) {
|
||||
$itemId = (int)$input['id'];
|
||||
}
|
||||
|
||||
if (!$itemId) {
|
||||
http_response_code(400);
|
||||
echo json_encode(['status' => 'error', 'message' => 'Missing item ID']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$author = !empty($input['author']) ? trim($input['author']) : $authorName;
|
||||
$ok = $repo->updateItemDetails($itemId, $input, $author);
|
||||
|
||||
if ($ok) {
|
||||
echo json_encode(['status' => 'success', 'message' => "Item #{$itemId} updated successfully"]);
|
||||
} else {
|
||||
http_response_code(400);
|
||||
echo json_encode(['status' => 'error', 'message' => 'Failed to update item']);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// Detail View of a single item
|
||||
if ($itemId > 0 && $method === 'GET') {
|
||||
$details = $repo->getItemDetails($itemId);
|
||||
@@ -176,6 +205,8 @@ try {
|
||||
'type' => $_GET['type'] ?? 'all',
|
||||
'status' => $_GET['status'] ?? 'all',
|
||||
'severity' => $_GET['severity'] ?? 'all',
|
||||
'push_id' => $_GET['push_id'] ?? '',
|
||||
'target_agent' => $_GET['target_agent'] ?? $_GET['agent'] ?? '',
|
||||
'search' => $_GET['search'] ?? $_GET['q'] ?? '',
|
||||
];
|
||||
|
||||
|
||||
@@ -71,8 +71,9 @@ try {
|
||||
'error_hash' => $result['error_hash'],
|
||||
'type' => $result['type'],
|
||||
'environment' => $result['environment'],
|
||||
'push_id' => $result['push_id'] ?? null,
|
||||
'message' => $result['is_new']
|
||||
? ($result['type'] === 'bug' ? 'New bug reported successfully.' : 'New feature request submitted.')
|
||||
? ($result['type'] === 'bug' ? 'New bug reported successfully.' : 'New feature request / idea submitted.')
|
||||
: 'Recurring bug count updated.',
|
||||
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user