From 48a01ac744d34f478d2d9f04593a41353710cce4 Mon Sep 17 00:00:00 2001 From: yokesh22 Date: Tue, 16 Jul 2024 18:26:22 +0530 Subject: [PATCH] part-a fixes --- src/Components/CustomQueryExecutorCard.jsx | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/Components/CustomQueryExecutorCard.jsx b/src/Components/CustomQueryExecutorCard.jsx index 3a5f0db..e369a84 100644 --- a/src/Components/CustomQueryExecutorCard.jsx +++ b/src/Components/CustomQueryExecutorCard.jsx @@ -94,6 +94,39 @@ const CustomQueryExecutorCard = ({ } }; + const markAsPartc = async () => { + console.log("update markAsPartc"); + const payload = { + data, + }; + try { + setIsLoading(true); + const response = await fetch( + `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/markAsPartc`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(payload), + } + ); + setIsLoading(false); + const responseData = await response.json(); + if (responseData.status === "success") { + console.log("Updation successfull ...."); + const updatedData = { ...dataValue, is_backpage: 1 }; + // console.log("Data ===== ", updatedData); + setDataValue(updatedData); + // toast.success("Record Marked as Backpage ! ...."); + } else { + throw new Error(responseData?.message); + } + } catch (error) { + throw new Error(error); + } + }; + const updatePartAFront = async () => { console.log("update front"); const payload = {