Skip to content

Commit

Permalink
SingleTypeFormWrapper: Display custom error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gu-stav committed May 6, 2022
1 parent 39047e9 commit 12d99b1
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 12d99b1

Please sign in to comment.