| 39 | |
| 40 | // Add a Project |
| 41 | const addProject = async (title, description, gitHubLink, youTubeLink) => { |
| 42 | // API CALL - Add Projects |
| 43 | const response = await fetch(`${VITE_SERVER_PORT}/api/projects/addproject`, { |
| 44 | method: "POST", |
| 45 | headers: { |
| 46 | "Content-Type": "application/json", |
| 47 | "auth-token": localStorage.getItem('token') |
| 48 | }, |
| 49 | body: JSON.stringify({ title, description, gitHubLink, youTubeLink }), |
| 50 | }); |
| 51 | const project = await response.json(); |
| 52 | setUserProjects([project, ...userProjects]); |
| 53 | props.setProgress(100) |
| 54 | } |
| 55 | |
| 56 | // Delete a Project |
| 57 | const deleteProject = async (id) => { |