updated
This commit is contained in:
@@ -10,17 +10,18 @@ import {
|
||||
GlobeIcon,
|
||||
WalletIcon,
|
||||
} from "../../../../../components/icons/3dChartIcons";
|
||||
import { getUserData } from "../../../../../functions/getUserData";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
const TotalCardComponent = ({ object }: any) => {
|
||||
const [progress, setProgress] = useState<any>(0);
|
||||
const [measurements, setmeasurements] = useState<any>({});
|
||||
const [duration, setDuration] = useState("1h");
|
||||
const [name, setName] = useState(object.header ? object.header : "");
|
||||
|
||||
const email = localStorage.getItem("email") || "";
|
||||
const organization = email?.split("@")[1]?.split(".")[0];
|
||||
const { userName, userId, organization, email } = getUserData();
|
||||
const { header, flotingDuration, flotingMeasurements } = useChartStore();
|
||||
const { selectedChartId } = useWidgetStore();
|
||||
const { projectId } = useParams()
|
||||
|
||||
const iotApiUrl = process.env.REACT_APP_IOT_SOCKET_SERVER_URL;
|
||||
|
||||
@@ -61,7 +62,14 @@ const TotalCardComponent = ({ object }: any) => {
|
||||
if (object?.id !== "") {
|
||||
try {
|
||||
const response = await axios.get(
|
||||
`http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/v2/A_floatWidget/${object?.id}/${organization}`
|
||||
`http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/v2/A_floatWidget/${object?.id}/${organization}`, {
|
||||
headers: {
|
||||
Authorization: "Bearer <access_token>",
|
||||
"Content-Type": "application/json",
|
||||
token: localStorage.getItem("token") || "",
|
||||
refresh_token: localStorage.getItem("refreshToken") || "",
|
||||
},
|
||||
}
|
||||
);
|
||||
if (response.status === 200) {
|
||||
setmeasurements(response.data.Data.measurements);
|
||||
@@ -70,7 +78,7 @@ const TotalCardComponent = ({ object }: any) => {
|
||||
} else {
|
||||
echo.error("Failed to fetch saved inputs");
|
||||
}
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user