diff --git a/app/routes/analyze.tsx b/app/routes/analyze.tsx index df5ddfe..3492c16 100644 --- a/app/routes/analyze.tsx +++ b/app/routes/analyze.tsx @@ -359,13 +359,18 @@ export default function Analyze() { const formData = new FormData(); formData.append("_method", "DELETE"); formData.append("ticker", stock.ticker); - await fetch("/api/stocks", { method: "POST", body: formData }); + const res = await fetch("/api/stocks", { method: "POST", body: formData }); + if (!res.ok) { + console.error("[analyze] Delete API failed:", res.status); + return; + } } catch (err) { console.error("[analyze] Error deleting stock:", err); + return; } } - setStocks((s) => s.filter((stock) => stock.id !== id)); + setStocks((s) => s.filter((st) => st.id !== id)); }; const runAnalysis = async (id: string, ticker: string) => {