diff --git a/src/Components/Banner/BannerTable.jsx b/src/Components/Banner/BannerTable.jsx index 1185d0f..2c35e12 100644 --- a/src/Components/Banner/BannerTable.jsx +++ b/src/Components/Banner/BannerTable.jsx @@ -198,7 +198,16 @@ const BannerCommunity = ({ ), - "Button title": item?.CTO_button_title, + "Button title": + + {item?.CTO_button_title}, Active: ( { const [smallImageData, setSmallImageData] = useState({}); const [chips, setChips] = useState(); + console.log(error); const [valueQuill, setValueQuill] = useState(blog?.content); @@ -73,7 +74,6 @@ const EditBlogsAndArticles = () => { }, }); - useEffect(() => { if (data?.data) { setSelectedImage(`https://rubix.betadelivery.com/${blog?.profile_image}`); @@ -129,7 +129,7 @@ const EditBlogsAndArticles = () => { console.log("Mutation response:", response?.error?.status); console.log("Mutation response:", response?.data?.statusCode); console.log("Mutation response:", response?.data?.message); - console.log(response); + console.log(response?.error?.status?.error?.message); if (response?.data?.statusCode === 201) { setIsLoading01(false); @@ -143,7 +143,7 @@ const EditBlogsAndArticles = () => { }); reset(); navigate("/blogs-articles"); - }else if(response?.error?.status === 500){ + } else if (response?.error?.status === 500) { setIsLoading01(false); toast({ render: () => ( @@ -153,7 +153,13 @@ const EditBlogsAndArticles = () => { /> ), }); - + } else { + setIsLoading01(false); + toast({ + render: () => ( + + ), + }); } }) .catch((error) => { @@ -193,7 +199,6 @@ const EditBlogsAndArticles = () => { } }; - if (isLoading) { return ; } @@ -209,9 +214,6 @@ const EditBlogsAndArticles = () => { >
- - - @@ -240,7 +242,7 @@ const EditBlogsAndArticles = () => { className="d-flex w-100 p-2 justify-content-center flex-column align-items-center gap-3" > {false ? ( - + {/* Display profile */} @@ -587,8 +589,8 @@ const EditBlogsAndArticles = () => { - - + + {/* Author's Info @@ -788,7 +790,7 @@ const EditBlogsAndArticles = () => { - +
); diff --git a/src/Pages/Community/ComunityEditPage.jsx b/src/Pages/Community/ComunityEditPage.jsx index 6c67aa0..1d034d5 100644 --- a/src/Pages/Community/ComunityEditPage.jsx +++ b/src/Pages/Community/ComunityEditPage.jsx @@ -101,6 +101,13 @@ const ComunityEditPage = () => { }); navigate("/community"); // setDeleteAlert(false); + } else { + setIsLoading01(false); + toast({ + render: () => ( + + ), + }); } }) .catch((error) => { diff --git a/src/Pages/Community/ComunityViewPage.jsx b/src/Pages/Community/ComunityViewPage.jsx index 8c68a91..fc25710 100644 --- a/src/Pages/Community/ComunityViewPage.jsx +++ b/src/Pages/Community/ComunityViewPage.jsx @@ -30,7 +30,7 @@ const ComunityViewPage = () => {
diff --git a/src/Services/api.service.js b/src/Services/api.service.js index 67f5d66..244263e 100644 --- a/src/Services/api.service.js +++ b/src/Services/api.service.js @@ -251,6 +251,12 @@ export const rubixApi = createApi({ }), getBlogById: builder.query({ query: (id) => `/admin/blog/${id}`, + transformResponse: (response) => { + if (response.error) { + throw new Error(response.error.message); + } + return response; + }, providesTags: ["getBlogById"], }), createBlog: builder.mutation({