diff --git a/deploy.sh b/deploy.sh index 6c279da..6f33528 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,7 +1,7 @@ #! /bin/bash SOURCE_DIR=/home/neuu/attendence_UI/frontend -BRANCH=master +BRANCH=part_a_playground FRONTEND_DIR=/var/www/exampaper.vidh.ai SERVER_IP=52.66.73.43 diff --git a/src/Components/CustomQueryExecutorCard.jsx b/src/Components/CustomQueryExecutorCard.jsx index 6b3c111..4314214 100644 --- a/src/Components/CustomQueryExecutorCard.jsx +++ b/src/Components/CustomQueryExecutorCard.jsx @@ -10,6 +10,8 @@ import { useNavigate } from "react-router-dom"; import RotateLeftIcon from "@mui/icons-material/RotateLeft"; import RotateRightIcon from "@mui/icons-material/RotateRight"; import PlayGroundEditContainer from "./PlayGroundEditContainer" +import saveRotatedImage from "./Utilities/PlaygroundUtilities" + const CustomQueryExecutorCard = ({ data, @@ -50,6 +52,9 @@ const CustomQueryExecutorCard = ({ if (tableName) { setTableNameData(tableName); } + if(data?.subject_code){ + + } }, [data]); const updatePartAInstructions = async () => { @@ -176,7 +181,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 { throw new Error(responseData?.message); } @@ -261,7 +266,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 { throw new Error(responseData?.message); } @@ -304,38 +309,6 @@ const CustomQueryExecutorCard = ({ setValues(Object.values(dataValue)); }, [dataValue]); - const saveRotatedImage = async () => { - try { - if (rotateAngle === 0) { - return; - } - const payload = { - imageName, - tableNameData, - rotateAngle, - s3_path: data[s3_image_column], - }; - setIsLoading(true); - const response = await fetch( - `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/saveRotatedImage`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(payload), - } - ); - setIsLoading(false); - const responseData = await response.json(); - if (responseData.status === "success") { - // toast.success("Image Rotation Saved Successfully") - } - } catch (error) { - setIsLoading(false); - throw new Error(error); - } - }; const rotate_and_process = async () => { setIsLoading(true); @@ -449,7 +422,7 @@ const CustomQueryExecutorCard = ({ diff --git a/src/Components/PlayGroundEditContainer.jsx b/src/Components/PlayGroundEditContainer.jsx index dc3ecdb..8608d9d 100644 --- a/src/Components/PlayGroundEditContainer.jsx +++ b/src/Components/PlayGroundEditContainer.jsx @@ -9,6 +9,7 @@ import { NavLink, Link } from "react-router-dom"; import TextInputField from "./TextInputField"; import { Height } from "@mui/icons-material"; import HighlightOffIcon from "@mui/icons-material/HighlightOff"; +import {toast} from "react-toastify" const PlayGroundEditContainer = ({ data, @@ -70,9 +71,11 @@ const PlayGroundEditContainer = ({ console.log("response data ========= ", responseData); if (responseData?.status === "success") { toast.success("Record Updated Successfully ..."); + setShowEditContainer(false) } } catch (error) { setIsLoading(false); + toast.error("Something Went Wrong ..."); throw new Error(error); } }; diff --git a/src/Components/Utilities/PlaygroundUtilities.jsx b/src/Components/Utilities/PlaygroundUtilities.jsx new file mode 100644 index 0000000..39908a3 --- /dev/null +++ b/src/Components/Utilities/PlaygroundUtilities.jsx @@ -0,0 +1,34 @@ +import { toast } from "react-toastify"; + +export const saveRotatedImage = async (tableName,tableNameData,rotateAngle,s3_path,data) => { + try { + if (rotateAngle === 0) { + return; + } + const payload = { + imageName, + tableNameData, + rotateAngle, + s3_path: data[s3_image_column], + }; + setIsLoading(true); + const response = await fetch( + `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/saveRotatedImage`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(payload), + } + ); + setIsLoading(false); + const responseData = await response.json(); + if (responseData.status === "success") { + toast.success("Image Rotation Saved Successfully") + } + } catch (error) { + setIsLoading(false); + throw new Error(error); + } + }; \ No newline at end of file