()
| 26 | }; |
| 27 | |
| 28 | const getUserProfile = async () => { |
| 29 | try { |
| 30 | const response = await fetch(`${VITE_SERVER_PORT}/api/profile/fetchprofile`, { |
| 31 | method: 'GET', |
| 32 | headers: { |
| 33 | 'Content-Type': 'application/json', |
| 34 | 'auth-token': localStorage.getItem('token'), |
| 35 | }, |
| 36 | }); |
| 37 | const json = await response.json(); |
| 38 | setUserProfile(json); |
| 39 | } catch (error) { |
| 40 | console.error('Error fetching profile:', error); |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | const updateUserProfile = async (name, college, phone, address) => { |
| 45 | try { |
no outgoing calls
no test coverage detected