MCPcopy Create free account
hub / github.com/RyGuy994/MATER / fetchNotes

Function fetchNotes

MATER_FE/src/components/notes/NotesForm.jsx:29–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 3

NotesFormFunction · 0.85
handleSubmitFunction · 0.85
confirmDeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected