()
| 45 | }, [organizationId]) |
| 46 | |
| 47 | const fetchAlerts = async () => { |
| 48 | try { |
| 49 | const response = await fetch(`/api/orgs/${organizationId}/alerts`) |
| 50 | |
| 51 | if (response.ok) { |
| 52 | const data = await response.json() |
| 53 | setAlerts(data.alerts || []) |
| 54 | } |
| 55 | } catch (error) { |
| 56 | console.error('Error fetching billing alerts:', error) |
| 57 | } finally { |
| 58 | setLoading(false) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | const dismissAlert = async (alertId: string) => { |
| 63 | try { |
no test coverage detected