feat: Automate Buy Box tracker sync from Dropbox and improve parsing robustness

This commit is contained in:
Christian Vidal Wolf
2026-02-05 08:39:39 +01:00
parent c4ad999619
commit 09e06bad16
3 changed files with 93 additions and 18 deletions
+3 -3
View File
@@ -222,8 +222,8 @@ const App: React.FC = () => {
const handleBuyBoxFetch = useCallback(async () => {
try {
console.log('[App] Fetching Buy Box data from /Buy_Box_tracker.xlsx...');
const response = await fetch('/Buy_Box_tracker.xlsx');
console.log('[App] Fetching Buy Box data from /api/fetch-buybox...');
const response = await fetch('/api/fetch-buybox');
if (!response.ok) throw new Error(`Failed to fetch Buy Box data: ${response.status}`);
const buffer = await response.arrayBuffer();
@@ -678,7 +678,7 @@ const App: React.FC = () => {
<div className="flex items-center gap-6">
{/* Force Sync Action */}
<button
onClick={() => { handleDataFetch(); handleAdsFetch(); handleTrafficFetch(); handleVendorStockFetch(); }}
onClick={() => { handleDataFetch(); handleAdsFetch(); handleTrafficFetch(); handleVendorStockFetch(); handleBuyBoxFetch(); }}
disabled={syncing}
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-black uppercase tracking-widest transition-all
${syncing