Refactor collaboration APIs to include versionId in relevant functions and clean up commented code

This commit is contained in:
2025-06-24 12:21:12 +05:30
parent 3fe52e3e7c
commit a562a51025
8 changed files with 26 additions and 28 deletions

View File

@@ -5,7 +5,8 @@ export const createThreadApi = async (
state: string,
position: any,
rotation: any,
threadTitle: any
threadTitle: any,
versionId?: string
) => {
try {
const response = await fetch(`${url_Backend_dwinzo}/api/v1/upsetThread`, {
@@ -16,13 +17,20 @@ export const createThreadApi = async (
token: localStorage.getItem("token") || "",
refresh_token: localStorage.getItem("refreshToken") || "",
},
body: JSON.stringify({ projectId, state, position, rotation, threadTitle }),
body: JSON.stringify({
projectId,
state,
position,
rotation,
threadTitle,
versionId,
}),
});
if (!response.ok) {
console.error("Failed to add project");
}
const result = await response.json();
console.log('result: ', result);
console.log("result: ", result);
return result;
} catch (error) {
if (error instanceof Error) {