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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user