- updated code - fixed displaying error message;
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { is, isNil, isEmpty } from 'ramda';
|
import { is, isNil, isEmpty, pathOr } from 'ramda';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
import { storeSet, useStoreValue } from '../../store';
|
import { storeSet, useStoreValue } from '../../store';
|
||||||
@@ -297,6 +297,15 @@ const BandoEdit = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const errUnpublishCallback = (resp) => {
|
const errUnpublishCallback = (resp) => {
|
||||||
|
const message = pathOr('', ['data', 'message'], resp);
|
||||||
|
console.log('resp', resp, message())
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: message,
|
||||||
|
detail: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
standardErrCallback(resp);
|
standardErrCallback(resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user