Files
Dwinzo_Demo/app/src/services/factoryBuilder/collab/giveCollabAccess.ts

32 lines
843 B
TypeScript
Raw Normal View History

2025-06-10 15:28:23 +05:30
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export default async function giveCollabAccess(
email: string,
isShare: boolean,
organization: string
) {
try {
const response = await fetch(`${url_Backend_dwinzo}/api/v1/shareUser`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email, isShare, organization }),
});
if (!response.ok) {
console.error("Failed to set Camera Position and Target");
2025-06-10 15:28:23 +05:30
}
const result = await response.json();
return result;
} catch (error) {
echo.error("Failed to give collab access");
if (error instanceof Error) {
2025-06-23 09:37:53 +05:30
console.log(error.message);
2025-06-10 15:28:23 +05:30
} else {
2025-06-23 09:37:53 +05:30
console.log("An unknown error occurred");
2025-06-10 15:28:23 +05:30
}
}
}