This commit is contained in:
Pradeeppon01 2024-07-12 17:58:01 +05:30
parent c49c08e655
commit 0d1c8f0101
3 changed files with 38 additions and 3 deletions

4
.env
View File

@ -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"
VITE_REACT_APP_BACKEND_URL="http://localhost:9999"
# VITE_REACT_APP_BACKEND_URL="https://api.exampaper.vidh.ai"

View File

@ -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 (
<Box className="w-100 rounded shadow mb-5 bg-white">
<Box className="p-4 d-flex justify-content-between align-items-start">

View File

@ -8,6 +8,7 @@ export const updatePartAanomolyData = (data) => ({
payload: data,
});
export const updateSystemNo = (data) => ({
type: "UPDATE_SYSTEM_NO",
payload: data,