- updated code - fixed displaying error message;
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { is, isNil, isEmpty } from 'ramda';
|
||||
import { is, isNil, isEmpty, pathOr } from 'ramda';
|
||||
|
||||
// store
|
||||
import { storeSet, useStoreValue } from '../../store';
|
||||
@@ -297,6 +297,15 @@ const BandoEdit = () => {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user