Fix api transformers, intercept by error message instead of undefined

This commit is contained in:
Maksim Eltyshev
2019-10-25 21:38:14 +05:00
parent 8e0e819309
commit 4a6553d241
3 changed files with 23 additions and 11 deletions

View File

@@ -45,7 +45,9 @@ module.exports = {
deletedAt: null
})
.set(inputs.values)
.intercept(undefined, 'conflict');
.intercept({
message: 'Unexpected error from database adapter: conflicting key value violates exclusion constraint "user_email_unique"'
}, 'conflict');
if (user) {
if (inputs.record.avatar && user.avatar !== inputs.record.avatar) {