Skip to content

Commit

Permalink
Merge pull request #13257 from strapi/fix/single-types-custom-error
Browse files Browse the repository at this point in the history
SingleTypeFormWrapper: Display custom error messages
  • Loading branch information
gu-stav committed May 9, 2022
2 parents 1db90d8 + 12d99b1 commit fdf1e88
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -143,8 +143,8 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {

const displayErrors = useCallback(
err => {
const errorPayload = err.response.payload;
let errorMessage = get(errorPayload, ['message'], 'Bad Request');
const errorPayload = err.response.data;
let errorMessage = get(errorPayload, ['error', 'message'], 'Bad Request');

// TODO handle errors correctly when back-end ready
if (Array.isArray(errorMessage)) {
Expand Down

0 comments on commit fdf1e88

Please sign in to comment.