From 92ab798b81816b12628b8daf2faf09f1726f3bd7 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 10 Apr 2025 17:25:54 +0200 Subject: [PATCH] - updated code - fixed displaying error message; --- src/pages/BandoEdit/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/BandoEdit/index.js b/src/pages/BandoEdit/index.js index bb02088..c12e801 100644 --- a/src/pages/BandoEdit/index.js +++ b/src/pages/BandoEdit/index.js @@ -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); }