Skip to content

Commit

Permalink
added fetch projects feature
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamRatnaparkhi committed Dec 30, 2022
1 parent 088a308 commit 9689490
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/pages/Projects/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ const Projects = () => {
useEffect(() => {
const fetchProjects = async () => {
await axiosInstance.get("/api/projects/getProjects").then((res) => {
setProjects(res.data.data);
if (res.status === 200)
setProjects(res.data.data);
})
}
fetchProjects();
console.log(projects);
},[]);

const fetchProject = async (id) => {
await axiosInstance.get(`/api/projects/getProject/${id}`).then((res) => {
return res.data.data;
if (res.status === 200)
return res.data.data;
})
}

Expand Down

0 comments on commit 9689490

Please sign in to comment.