updated dashboard duplication
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user