From 0f2200fd25472711900b99e2c90b6e1c770b2080 Mon Sep 17 00:00:00 2001 From: pawan-dot <71133473+pawan-dot@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:49:44 +0530 Subject: [PATCH] product functionality added --- resources/Blog/BlogController.js | 8 +++----- resources/Currency/CurrencyRoute.js | 8 +------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/resources/Blog/BlogController.js b/resources/Blog/BlogController.js index 07f49bf..339a098 100644 --- a/resources/Blog/BlogController.js +++ b/resources/Blog/BlogController.js @@ -25,8 +25,7 @@ export const createBlog = async (req, res) => { // Create the blog post const blog = await Blog.create({ title, - tags: tags.split(/\s*,\s*|\s+/) - .filter(tag => tag.trim() !== ''), // Splitting tags string into array + tags: tags.split(/\s*,\s*|\s+/).filter((tag) => tag.trim() !== ""), // Splitting tags string into array image, blog_content, }); @@ -104,7 +103,7 @@ export const deleteImageFromCloudinary = async (req, res) => { if (response) { res.status(200).json({ success: true, - msg: "Blog Deleted Successfully!!", + msg: "Image Deleted Successfully!!", }); } } catch (error) { @@ -161,8 +160,7 @@ export const updateBlog = async (req, res) => { // Prepare an object for the updated testimonial data const updatedBlogData = { title, - tags: tags.split(/\s*,\s*|\s+/) - .filter(tag => tag.trim() !== ''), // Splitting tags string into array + tags: tags.split(/\s*,\s*|\s+/).filter((tag) => tag.trim() !== ""), // Splitting tags string into array blog_content, }; diff --git a/resources/Currency/CurrencyRoute.js b/resources/Currency/CurrencyRoute.js index d1dd32d..8cbf58f 100644 --- a/resources/Currency/CurrencyRoute.js +++ b/resources/Currency/CurrencyRoute.js @@ -22,13 +22,7 @@ router authorizeRoles("admin", "Employee"), deletecarrency ); -// router -// .route("/deleteImage/jatinMor/Blog/:public_id") -// .delete( -// isAuthenticatedUser, -// authorizeRoles("admin", "Employee"), -// deleteImageFromCloudinary -// ); + router .route("/:id") .patch(