Skip to content
Snippets Groups Projects
Commit 9f858de2 authored by Neda Moeini's avatar Neda Moeini
Browse files

Enhance showing errors.

parent 52c40ad3
No related branches found
No related tags found
1 merge request!6Enhancement/improve error messages
......@@ -85,10 +85,10 @@
li.textContent = 'You are not authorized to perform this action.';
errorList.appendChild(li);
} else if (response.status === 400 && result.status === 'error') {
for (const [field, messages] of Object.entries(result.errors)) {
for (const messages of Object.values(result.errors)) {
messages.forEach(message => {
const li = document.createElement('li');
li.textContent = `${field}: ${message}`;
li.textContent = message;
errorList.appendChild(li);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment