mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed handling for grouped validation errors during members import
refs 7904c303a7
- Model's validation errors are sometimes returned as an array of errors, in those cases they should be flattened to before returning to the client. This way there is more insight into what went wrong during the import.
This commit is contained in:
parent
4716d13d13
commit
e698f9f95c
1 changed files with 2 additions and 2 deletions
|
@ -501,13 +501,13 @@ const members = {
|
|||
// for this reason we have to make sure any unexpected errors are logged here
|
||||
if (Array.isArray(error)) {
|
||||
logging.error(error[0]);
|
||||
invalid.errors.push(...error);
|
||||
} else {
|
||||
logging.error(error);
|
||||
invalid.errors.push(error);
|
||||
}
|
||||
|
||||
invalid.count = invalid.count + 1;
|
||||
|
||||
invalid.errors.push(error);
|
||||
}
|
||||
});
|
||||
}).then(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue