From c948502c26c703f1c11af598dfd007c6319ad07c Mon Sep 17 00:00:00 2001 From: yokesh22 Date: Tue, 16 Jul 2024 17:50:16 +0530 Subject: [PATCH 1/3] . --- src/Components/CustomQueryExecutorCard.jsx | 6 +++--- src/Components/PlayGroundEditContainer.jsx | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Components/CustomQueryExecutorCard.jsx b/src/Components/CustomQueryExecutorCard.jsx index 875b639..3a5f0db 100644 --- a/src/Components/CustomQueryExecutorCard.jsx +++ b/src/Components/CustomQueryExecutorCard.jsx @@ -151,7 +151,7 @@ const CustomQueryExecutorCard = ({ const updatedData = { ...dataValue, is_backpage: 1 }; // console.log("Data ===== ", updatedData); setDataValue(updatedData); - toast.success("Record Marked as Frontpage ! ...."); + // toast.success("Record Marked as Frontpage ! ...."); } else { toast.error("Something Went Wrong !..."); setIsLoading(false) @@ -185,7 +185,7 @@ const CustomQueryExecutorCard = ({ const updatedData = { ...dataValue, is_backpage: 1 }; // console.log("Data ===== ", updatedData); setDataValue(updatedData); - toast.success("Record Marked as Backpage ! ...."); + // toast.success("Record Marked as Backpage ! ...."); } else { setIsLoading(false); toast.error("Something Went Wrong !..."); @@ -272,7 +272,7 @@ const CustomQueryExecutorCard = ({ // console.log("Data ===== ", updatedData); setDataValue(updatedData); console.log("Updation successfull ...."); - toast.success("Record Marked As Ev !..."); + // toast.success("Record Marked As Ev !..."); } else { setIsLoading(false) toast.error("Something Went Wrong !..."); diff --git a/src/Components/PlayGroundEditContainer.jsx b/src/Components/PlayGroundEditContainer.jsx index 9c7dbdd..f95bb04 100644 --- a/src/Components/PlayGroundEditContainer.jsx +++ b/src/Components/PlayGroundEditContainer.jsx @@ -40,7 +40,7 @@ const PlayGroundEditContainer = ({ const handleClose = () => { setOpen(false); }; - + console.log("image_name ======================= ", imageName) useEffect(() => { if (data) { setQrcode(data?.qrcode); @@ -85,7 +85,7 @@ const PlayGroundEditContainer = ({ setIsLoading(false); console.log("response data ========= ", responseData); if (responseData?.status === "success") { - toast.success("Record Updated Successfully ..."); + // toast.success("Record Updated Successfully ..."); setShowEditContainer(false); } } catch (error) { @@ -99,6 +99,7 @@ const PlayGroundEditContainer = ({ console.log(registerNumber); console.log(subjectCode); console.log(barcode, qrcode); + console.log("image_name = ", imageName) console.log(!registerNumber && !subjectCode && (!barcode || !qrcode)); if (!registerNumber && !subjectCode && (!barcode || !qrcode)) { return; @@ -129,7 +130,7 @@ const PlayGroundEditContainer = ({ setIsLoading(false); console.log("response data ========= ", responseData); if (responseData?.status === "success") { - toast.success("Record Updated Successfully ..."); + // toast.success("Record Updated Successfully ..."); setShowEditContainer(false); } } catch (error) { From 48a01ac744d34f478d2d9f04593a41353710cce4 Mon Sep 17 00:00:00 2001 From: yokesh22 Date: Tue, 16 Jul 2024 18:26:22 +0530 Subject: [PATCH 2/3] 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 = { From 02a8ec95a9d3727d5085e50337a40dcdac745ae8 Mon Sep 17 00:00:00 2001 From: yokesh22 Date: Fri, 19 Jul 2024 18:15:40 +0530 Subject: [PATCH 3/3] . --- src/Components/CustomQueryExecutorCard.jsx | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/Components/CustomQueryExecutorCard.jsx b/src/Components/CustomQueryExecutorCard.jsx index e369a84..45e4f62 100644 --- a/src/Components/CustomQueryExecutorCard.jsx +++ b/src/Components/CustomQueryExecutorCard.jsx @@ -282,6 +282,38 @@ const CustomQueryExecutorCard = ({ } }; + const markAsPart_A = async () => { + const payload = { + data, + }; + try { + setIsLoading(true); + const response = await fetch( + `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/markAsPartA`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(payload), + } + ); + setIsLoading(false); + const responseData = await response.json(); + if (responseData.status === "success") { + const updatedData = { ...dataValue, is_cover: 1 }; + // console.log("Data ===== ", updatedData); + setDataValue(updatedData); + console.log("Updation successfull ...."); + // toast.success("Record Marked As Ev !..."); + } else { + throw new Error(responseData?.message); + } + } catch (error) { + throw new Error(error); + } + }; + const markAsDummy = async () => { const payload = { data, @@ -335,6 +367,7 @@ const CustomQueryExecutorCard = ({ { btnLabel: "Mark As Back", action: updateBack }, { btnLabel: "Mark As Ev", action: updateEvCover }, { btnLabel: "Mark As Dummy", action: markAsDummy }, + {btnLabel: "Mark As Part-A", action: markAsPart_A}, { btnLabel: "Edit", action: showContainerAction }, ], PartA: [