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 ) => { try { const response = await fetch( `${url_Backend_dwinzo}/api/V1/project/Duplicate`, { method: "POST", headers: { Authorization: "Bearer ", // Replace with actual token "Content-Type": "application/json", token: localStorage.getItem("token") || "", // Coerce null to empty string refresh_token: localStorage.getItem("refreshToken") || "", }, body: JSON.stringify({ refProjectID, projectUuid, thumbnail, projectName, }), } ); const newAccessToken = response.headers.get("x-access-token"); if (newAccessToken) { // localStorage.setItem("token", newAccessToken); } if (!response.ok) { } const result = await response.json(); // return result; } catch (error) { if (error instanceof Error) { } else { } } };