Improve CARD action error messages and default loader columns

Show actual CARD API error messages (e.g., 'Cannot redirect asset
because Team is neither confirmed nor pending owner') instead of
generic 'Redirect failed.' or 'confirm failed.' messages.

Also auto-select IPV4_ADDRESS, EQUIP_NAME, and RESPONSIBLE_TEAM
columns by default in the Loader Modal for better initial UX.
This commit is contained in:
Jordan Ramos
2026-05-28 14:25:37 -06:00
parent 93811eda10
commit a6e455311e
2 changed files with 9 additions and 3 deletions

View File

@@ -1669,7 +1669,8 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
});
const data = await res.json();
if (!res.ok) {
setCardActionError(data.error || `${actionType} failed.`);
const errorMsg = data.error || data.message || (typeof data === 'string' ? data : `${actionType} failed.`);
setCardActionError(errorMsg);
setCardActionLoading(false);
return;
}
@@ -1703,7 +1704,8 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
});
const data = await res.json();
if (!res.ok) {
setCardActionError(data.error || 'Redirect failed.');
const errorMsg = data.error || data.message || (typeof data === 'string' ? data : JSON.stringify(data));
setCardActionError(errorMsg);
setCardActionLoading(false);
return;
}