Add versionId parameter to addingWidgets function and update widget calls
This commit is contained in:
@@ -118,7 +118,7 @@ const BarChartInput = (props: Props) => {
|
||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||
|
||||
// }
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId);
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId, selectedVersion?.versionId || "");
|
||||
|
||||
|
||||
if(response.message==="Widget updated successfully"){
|
||||
|
||||
@@ -234,7 +234,7 @@ const LineGrapInput = (props: Props) => {
|
||||
// if (visualizationSocket) {
|
||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||
// }
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||
|
||||
if (response.message === "Widget updated successfully") {
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ const PieChartInput = (props: Props) => {
|
||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||
// }
|
||||
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||
|
||||
if (response.message === "Widget updated successfully") {
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ const Progress1Input = (props: Props) => {
|
||||
// if (visualizationSocket) {
|
||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||
// }
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||
|
||||
if (response.message === "Widget updated successfully") {
|
||||
|
||||
|
||||
@@ -119,12 +119,12 @@ const Progress2Input = (props: Props) => {
|
||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||
// }
|
||||
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId);
|
||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||
|
||||
if(response.message==="Widget updated successfully"){
|
||||
if (response.message === "Widget updated successfully") {
|
||||
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
@@ -4,7 +4,8 @@ export const addingWidgets = async (
|
||||
zoneUuid: string,
|
||||
organization: string,
|
||||
widget: {},
|
||||
projectId?: string
|
||||
projectId?: string,
|
||||
versionId?: string
|
||||
) => {
|
||||
|
||||
try {
|
||||
@@ -16,7 +17,7 @@ export const addingWidgets = async (
|
||||
token: localStorage.getItem("token") || "",
|
||||
refresh_token: localStorage.getItem("refreshToken") || "",
|
||||
},
|
||||
body: JSON.stringify({ organization, zoneUuid, widget, projectId }),
|
||||
body: JSON.stringify({ organization, zoneUuid, widget, projectId, versionId }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user