Add versioning support to collaboration features and API calls

- Adjust logic in socket responses to handle versioning for comments and threads.
This commit is contained in:
2025-06-24 11:56:26 +05:30
parent b49f431ebf
commit 3fe52e3e7c
8 changed files with 99 additions and 57 deletions

View File

@@ -1,10 +1,15 @@
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
// let url_Backend_dwinzo = `http://192.168.0.102:5000`;
export const deleteThreadApi = async (projectId: string, threadId: string) => {
export const deleteThreadApi = async (
projectId: string,
threadId: string,
versionId: string
) => {
const body: any = {
projectId,
threadId,
versionId,
};
try {

View File

@@ -1,9 +1,10 @@
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export const getAllThreads = async (projectId: string) => {
export const getAllThreads = async (projectId: string, versionId: string) => {
console.log("projectId: ", projectId, versionId);
try {
const response = await fetch(
`${url_Backend_dwinzo}/api/v1/Threads/${projectId}`,
`${url_Backend_dwinzo}/api/v1/Threads/${projectId}/${versionId}`,
{
method: "GET",
headers: {
@@ -21,7 +22,6 @@ export const getAllThreads = async (projectId: string) => {
}
const result = await response.json();
console.log('result: ', result);
return result;
} catch (error) {