Tableau Download Versions - [extra Quality]

// Log download for analytics await prisma.download_log.create( data: version_id: id, os, user_ip: req.ip, downloaded_at: new Date() );

useEffect(() => fetch( /api/tableau/versions?$new URLSearchParams(filters) ) .then(res => res.json()) .then(setVersions); , [filters]); tableau download versions

// Optional: generate signed URL if using S3 res.json( download_url: asset.download_url, checksum: asset.checksum_sha256 ); ); // TableauVersions.jsx import useState, useEffect from 'react'; export default function TableauVersions() const [versions, setVersions] = useState([]); const [filters, setFilters] = useState( product: 'Desktop', os: [], status: 'active' ); const [selectedVersion, setSelectedVersion] = useState(null); // Log download for analytics await prisma

const versions = await prisma.tableau_versions.findMany( where, include: assets: true , orderBy: release_date: 'desc' , skip, take: parseInt(limit) ); downloaded_at: new Date() )

res.json( data: versions, page, limit ); }); router.get('/versions/:id/download', async (req, res) => const id = req.params; const os = req.query; const version = await prisma.tableau_versions.findUnique( where: id , include: assets: true );

const asset = version.assets.find(a => a.os === os); if (!asset) return res.status(404).json( error: 'Asset not found' );