()
| 27 | }, [asset_Id]); |
| 28 | |
| 29 | const fetchNotes = async () => { |
| 30 | setLoading(true); |
| 31 | try { |
| 32 | const response = await fetch(`${baseUrl}/notes/notes?type=asset&type_id=${asset_Id}`, { |
| 33 | method: 'GET', |
| 34 | headers: { |
| 35 | 'Content-Type': 'application/json', |
| 36 | 'Authorization': `Bearer ${jwtToken}`, |
| 37 | }, |
| 38 | }); |
| 39 | const data = await response.json(); |
| 40 | setNotes(data.notes || []); |
| 41 | } catch (error) { |
| 42 | console.error('Error fetching notes:', error); |
| 43 | toast.error('Failed to fetch notes'); |
| 44 | } finally { |
| 45 | setLoading(false); |
| 46 | } |
| 47 | }; |
| 48 | |
| 49 | const handleInputChange = (e) => { |
| 50 | const { name, value } = e.target; |
no outgoing calls
no test coverage detected