(id)
| 55 | |
| 56 | // Delete a Project |
| 57 | const deleteProject = async (id) => { |
| 58 | // API CALL - Delete Project |
| 59 | const response = await fetch(`${VITE_SERVER_PORT}/api/projects/deleteproject/${id}`, { |
| 60 | method: "DELETE", |
| 61 | headers: { |
| 62 | "Content-Type": "application/json", |
| 63 | "auth-token": localStorage.getItem('token') |
| 64 | }, |
| 65 | body: JSON.stringify(), |
| 66 | }); |
| 67 | const json = await response.json(); |
| 68 | console.log(json) |
| 69 | const newProjects = userProjects.filter((project) => { return project._id !== id }); |
| 70 | setUserProjects(newProjects); |
| 71 | } |
| 72 | |
| 73 | // Edit a Project |
| 74 | const editProject = async (id, title, description, gitHubLink, youTubeLink) => { |
no outgoing calls
no test coverage detected