Handle api error 'detail' key as generic form error

This commit is contained in:
Jake McDermott 2020-02-26 12:44:20 -05:00
parent 22d4e60028
commit 43cce83ba1
No known key found for this signature in database
GPG Key ID: 0E56ED990CDFCB4F

View File

@ -15,6 +15,8 @@ function FormSubmitError({ error }) {
setErrors(errorMessages);
if (errorMessages.__all__) {
setErrorMessage(errorMessages.__all__);
} else if (errorMessages.detail) {
setErrorMessage(errorMessages.detail);
} else {
setErrorMessage(null);
}