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

Enhance showing errors.

parent 52c40ad3
Branches
Tags
1 merge request!6Enhancement/improve error messages
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
......@@ -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.
Please register or to comment