Fixed api send on ticket resolution

This commit is contained in:
2026-01-08 12:48:06 -05:00
parent de9da756e9
commit d76ff7aad0

View File

@@ -404,9 +404,15 @@ function updateTicketStatus() {
})
.then(response => {
if (!response.ok) {
return response.json().then(data => {
console.error('Server error response:', data);
throw new Error(data.error || 'Server returned an error');
}).catch(jsonError => {
// If JSON parsing fails, try to get text
return response.text().then(text => {
console.error('Server response:', text);
throw new Error('Network response was not ok');
console.error('Server response (non-JSON):', text);
throw new Error(text || 'Network response was not ok');
});
});
}
return response.json();