Files
Dwinzo_dev/app/src/services/marketplace/fetchAssetDetails.ts

23 lines
642 B
TypeScript

let BackEnd_url = `http://${process.env.REACT_APP_SERVER_MARKETPLACE_URL}`;
export const getAssetDetails = async (filename: string) => {
try {
const response = await fetch(`${BackEnd_url}/api/v1/assetDetails`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ filename }),
});
if (!response.ok) {
throw new Error("Failed to fetch asset details");
}
const result = await response.json();
return result;
} catch (error: any) {
// console.error("Error fetching category:", error.message);
throw new Error(error.message);
}
};