From 0d1c8f01013b4827e96546e23e93cde5d9db5632 Mon Sep 17 00:00:00 2001 From: Pradeeppon01 Date: Fri, 12 Jul 2024 17:58:01 +0530 Subject: [PATCH] latest --- .env | 4 +-- src/Components/CustomQueryExecutorCard.jsx | 36 +++++++++++++++++++++- src/redux/actions/actions.jsx | 1 + 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.env b/.env index a596950..5025c8b 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ #VITE_REACT_APP_BACKEND_URL="https://sandbox.exampaper.vidh.ai" METABASE_BASE_URL="http://metabase.usln.in/public/question/d8774923-09bb-4cd9-903b-559d417e12cf" -# VITE_REACT_APP_BACKEND_URL="http://localhost:9999" -VITE_REACT_APP_BACKEND_URL="https://api.exampaper.vidh.ai" \ No newline at end of file +VITE_REACT_APP_BACKEND_URL="http://localhost:9999" +# VITE_REACT_APP_BACKEND_URL="https://api.exampaper.vidh.ai" \ No newline at end of file diff --git a/src/Components/CustomQueryExecutorCard.jsx b/src/Components/CustomQueryExecutorCard.jsx index 4314214..db52c25 100644 --- a/src/Components/CustomQueryExecutorCard.jsx +++ b/src/Components/CustomQueryExecutorCard.jsx @@ -10,7 +10,7 @@ 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" +// import saveRotatedImage from "./Utilities/PartCPlaygroundUtilities" const CustomQueryExecutorCard = ({ @@ -337,6 +337,40 @@ const CustomQueryExecutorCard = ({ } }; + +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); + } + }; + return ( diff --git a/src/redux/actions/actions.jsx b/src/redux/actions/actions.jsx index 4139a4f..fe5fb77 100644 --- a/src/redux/actions/actions.jsx +++ b/src/redux/actions/actions.jsx @@ -8,6 +8,7 @@ export const updatePartAanomolyData = (data) => ({ payload: data, }); + export const updateSystemNo = (data) => ({ type: "UPDATE_SYSTEM_NO", payload: data,