0
Fork 0
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:
Nazar Gargol 2020-06-19 16:34:23 +12:00
parent 4716d13d13
commit e698f9f95c

View file

@ -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(() => {