Skip to content

Commit

Permalink
Merge branch 'development' into fix/reddots
Browse files Browse the repository at this point in the history
  • Loading branch information
warreprovoost authored May 23, 2024
2 parents 902c5bb + e7129cd commit b844054
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/utils/fetches/FetchProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import {
ProjectDeadline,
ShortSubmission,
} from "../../pages/project/projectDeadline/ProjectDeadline.tsx";
import { Me } from "../../types/me.ts";
const API_URL = import.meta.env.VITE_APP_API_HOST;

export const fetchProjectPage = async () => {
const projects = await fetchProjects();
const me = await fetchMe();
const projects = await fetchProjects(me);
return { projects, me };
};

export const fetchProjects = async () => {
export const fetchProjects = async (me: Me) => {
try {
const response = await authenticatedFetch(`${API_URL}/projects`);
const jsonData = await response.json();
Expand All @@ -24,7 +25,7 @@ export const fetchProjects = async () => {
const project_id = url_split[url_split.length - 1];
const response_submissions = await (
await authenticatedFetch(
encodeURI(`${API_URL}/submissions?project_id=${project_id}`)
encodeURI(`${API_URL}/submissions?project_id=${project_id}&uid=${me.uid}`)
)
).json();

Expand Down

0 comments on commit b844054

Please sign in to comment.