diff --git a/src/pages/AssetDetail.tsx b/src/pages/AssetDetail.tsx index fc9d956..fb59400 100644 --- a/src/pages/AssetDetail.tsx +++ b/src/pages/AssetDetail.tsx @@ -7,6 +7,11 @@ import type { CreateAssetData, AssetFinanceBookRow } from '../services/assetServ import LinkField from '../components/LinkField'; import apiService from '../services/apiService'; // ✅ your ApiService +// Helper function to get the base URL for files +const getFileBaseUrl = () => { + // Always use the full URL to avoid proxy path duplication issues + return import.meta.env.VITE_FRAPPE_BASE_URL || 'https://seeraasm-med.seeraarabia.com'; +}; const AssetDetail: React.FC = () => { const { assetName } = useParams<{ assetName: string }>(); @@ -137,6 +142,9 @@ const AssetDetail: React.FC = () => { // Load asset data for editing or duplicating useEffect(() => { if (asset) { + // Debug: Log asset data to check if name field exists + console.log('Asset data loaded:', asset); + console.log('Asset name:', asset.name); setFormData({ asset_name: isDuplicating ? `${asset.asset_name} (Copy)` : (asset.asset_name || ''), company: asset.company || '', @@ -1323,19 +1331,44 @@ const AssetDetail: React.FC = () => { {/* QR Code */} - -
+ Asset ID: {asset.name} +
+ )} + {!asset && !loading && ( ++ Asset data not loaded +
+ )}