resolved bug in finding distance and some changes in marketplace

This commit is contained in:
2025-05-13 16:57:55 +05:30
parent 8848d78c3b
commit 890fdc889f
11 changed files with 391 additions and 413 deletions

View File

@@ -1,5 +1,6 @@
let BackEnd_url = `http://${process.env.REACT_APP_SERVER_MARKETPLACE_URL}`;
export const getAssetDetails = async (filename: string) => {
console.log('filename: ', filename);
try {
const response = await fetch(`${BackEnd_url}/api/v1/assetDetails`, {
method: "POST",

View File

@@ -1,7 +1,28 @@
let BackEnd_url = `http://${process.env.REACT_APP_SERVER_MARKETPLACE_URL}`;
export const fetchGltfUrl = (filename: string) => {
if (filename) {
return `${BackEnd_url}/api/v1/getAssetFile/${filename}`;
export const fetchGltfUrl = async (filename: string, AssetID: string) => {
try {
const response = await fetch(
`${BackEnd_url}/api/v2/assetDetails/${filename}/${AssetID}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
// body: JSON.stringify(assetData),
}
);
if (!response.ok) {
throw new Error("Failed to fetch asset details");
}
const result = await response.json();
// console.log("result: preview", result);
return result;
} catch (error: any) {
//
throw new Error(error.message);
}
return null; // or handle the case when filename is not provided
};