const handleStatusUpdate = async (investmentId, newStatus) => { const token = localStorage.getItem('token'); try { await axios.patch(`${BASE_URL}/investment/${investmentId}`, { investmentStatus: newStatus, note: newStatus === 'Onaylandı' ? 'Yatırım onaylandı' : 'Yatırım iptal edildi', resultDate: new Date().toISOString() }, { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } }); await fetchInvestments(); } catch (error) { console.error("Error updating status:", error); setError(error.response?.data?.detail || "Failed to update investment status"); } };