Skip to content

Commit

Permalink
fix: projects not fetching right API
Browse files Browse the repository at this point in the history
The underlying `ProjectsList` component didn't take care of namespaces
or forges so just fixing that fixed the issue

There was also a trailing forwardslash in the routing which was
incorrect
  • Loading branch information
Venefilyn authored and lachmanfrantisek committed Oct 9, 2023
1 parent e0fa68a commit 1d4fc6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frontend/src/app/Projects/ProjectsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ const ProjectsList: React.FC<ProjectsListProps> = (props) => {
// Fetch data from dashboard backend (or if we want, directly from the API)
const fetchData = ({ pageParam = 1 }): Promise<Project> =>
fetch(
`${import.meta.env.VITE_API_URL}/projects?page=${pageParam}`,
`${import.meta.env.VITE_API_URL}/projects${
props.forge ? "/" + props.forge : ""
}${props.namespace ? "/" + props.namespace : ""}?page=${pageParam}`,
).then((response) => response.json());

const { isInitialLoading, isError, fetchNextPage, data } = useInfiniteQuery(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const routes: RouteObject[] = [
},
},
{
path: "/projects/:forge/",
path: "/projects/:forge",
element: <Forge />,
},
{
Expand Down

0 comments on commit 1d4fc6f

Please sign in to comment.