Testing failer uncomment issue sorted API-Docker updated based on the Failed testcase

This commit is contained in:
2025-05-28 09:42:00 +05:30
parent f2cad42d30
commit 41e2075c55
90 changed files with 2485 additions and 4308 deletions

View File

@@ -1,50 +1,56 @@
let url_Backend_dwinzoMajor = "http://192.168.0.110:3503";
//Login Api
export const createCamera = async (userId:string, position:Object) => {
try {
const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/createCamera`, {
export const createCamera = async (userId: string, position: Object) => {
try {
const response = await fetch(
`${url_Backend_dwinzoMajor}/api/v1/createCamera`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ userId, position }),
});
if (!response.ok) {
throw new Error("Failed to create Camera");
}
const result = await response.json();
return result;
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error`
} else {
throw new Error("An unknown error occurred");
}
}
};
);
export const getCamera = async (userId:string) => {
try {
const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/getCamera/${userId}`, {
if (!response.ok) {
throw new Error("Failed to create Camera");
}
const result = await response.json();
return result;
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message);
} else {
throw new Error("An unknown error occurred");
}
}
};
export const getCamera = async (userId: string) => {
try {
const response = await fetch(
`${url_Backend_dwinzoMajor}/api/v1/getCamera/${userId}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
if (!response.ok) {
throw new Error("Failed to get Camera");
}
const result = await response.json();
return result;
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error`
} else {
throw new Error("An unknown error occurred");
}
);
if (!response.ok) {
throw new Error("Failed to get Camera");
}
};
const result = await response.json();
return result;
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message);
} else {
throw new Error("An unknown error occurred");
}
}
};