updated dashboard duplication

This commit is contained in:
2025-08-02 18:23:42 +05:30
parent a71346e7fd
commit 35153c8c79
9 changed files with 1782 additions and 1375 deletions

View File

@@ -1,6 +1,7 @@
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export const duplicateProject = async (
refProjectID: string,
projectUuid: string,
thumbnail: string,
projectName: string
@@ -16,7 +17,12 @@ export const duplicateProject = async (
token: localStorage.getItem("token") || "", // Coerce null to empty string
refresh_token: localStorage.getItem("refreshToken") || "",
},
body: JSON.stringify({ projectUuid, thumbnail, projectName }),
body: JSON.stringify({
refProjectID,
projectUuid,
thumbnail,
projectName,
}),
}
);
const newAccessToken = response.headers.get("x-access-token");
@@ -24,7 +30,7 @@ export const duplicateProject = async (
//console.log("New token received:", newAccessToken);
localStorage.setItem("token", newAccessToken);
}
// console.log("response: ", response);
console.log("response: ", response);
if (!response.ok) {
console.error("Failed to add project");
}

View File

@@ -30,6 +30,7 @@ export const updateProject = async (
body: JSON.stringify(body),
}
);
console.log('body: ', body);
const newAccessToken = response.headers.get("x-access-token");
if (newAccessToken) {
@@ -41,6 +42,7 @@ export const updateProject = async (
}
const result = await response.json();
console.log('result: ', result);
return result;
} catch (error) {
if (error instanceof Error) {