From 4942de25f2940e80e44cb36b5afd4c8a74a76f91 Mon Sep 17 00:00:00 2001 From: Enrico Bausenhart Date: Sun, 20 Jul 2025 18:08:29 +0200 Subject: [PATCH 1/4] fix: utc shift for demo request --- client/src/components/CreateMatchRequestDialog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/CreateMatchRequestDialog.tsx b/client/src/components/CreateMatchRequestDialog.tsx index 75b04ca5..58cf5a38 100644 --- a/client/src/components/CreateMatchRequestDialog.tsx +++ b/client/src/components/CreateMatchRequestDialog.tsx @@ -152,7 +152,9 @@ const CreateMatchRequestDialog: React.FC = ({ return; } - const formattedDate = selectedDate.toISOString().split('T')[0]; // YYYY-MM-DD format + const formattedDate = selectedDate + ? `${selectedDate.getFullYear()}-${String(selectedDate.getMonth() + 1).padStart(2, '0')}-${String(selectedDate.getDate()).padStart(2, '0')}` + : ''; const demoData = { userID: userID, From 3621f57268c34b6a5dc8494d0c3b852c53913377 Mon Sep 17 00:00:00 2001 From: Enrico Bausenhart Date: Sun, 20 Jul 2025 18:09:38 +0200 Subject: [PATCH 2/4] feat: info box for only one match request per day --- client/src/components/MatchRequests.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/components/MatchRequests.tsx b/client/src/components/MatchRequests.tsx index a2077841..ff524fa1 100644 --- a/client/src/components/MatchRequests.tsx +++ b/client/src/components/MatchRequests.tsx @@ -173,6 +173,9 @@ const MatchRequests = () => { return ( + + You can only create one match request per day. It is not possible to create two match requests for the same day. + From 2adbe32ba0f749337dd274f8ee961fa03d439502 Mon Sep 17 00:00:00 2001 From: Enrico Bausenhart Date: Sun, 20 Jul 2025 18:10:21 +0200 Subject: [PATCH 3/4] fix: adapt matching route --- client/src/services/matchesService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/services/matchesService.ts b/client/src/services/matchesService.ts index 5ff9fa10..e9ac0411 100644 --- a/client/src/services/matchesService.ts +++ b/client/src/services/matchesService.ts @@ -64,7 +64,7 @@ export const useMatchesService = () => { const acceptMatch = async (matchId: string): Promise => { try { - await api.post(`${API_VERSION}/matching/match/${matchId}/accept`); + await api.post(`${API_VERSION}/matching/rsvp/${matchId}/accept`); } catch (error) { console.error('Error accepting match:', error); throw error; @@ -73,7 +73,7 @@ export const useMatchesService = () => { const rejectMatch = async (matchId: string): Promise => { try { - await api.post(`${API_VERSION}/matching/match/${matchId}/reject`); + await api.post(`${API_VERSION}/matching/rsvp/${matchId}/reject`); } catch (error) { console.error('Error rejecting match:', error); throw error; From d544728c82d39acec5ba04bc1378f3f39ecca173 Mon Sep 17 00:00:00 2001 From: Enrico Bausenhart Date: Sun, 20 Jul 2025 22:26:38 +0200 Subject: [PATCH 4/4] fix: make reject and accept a get request --- client/src/services/matchesService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/services/matchesService.ts b/client/src/services/matchesService.ts index e9ac0411..3ff62e64 100644 --- a/client/src/services/matchesService.ts +++ b/client/src/services/matchesService.ts @@ -64,7 +64,7 @@ export const useMatchesService = () => { const acceptMatch = async (matchId: string): Promise => { try { - await api.post(`${API_VERSION}/matching/rsvp/${matchId}/accept`); + await api.get(`${API_VERSION}/matching/rsvp/${matchId}/accept`); } catch (error) { console.error('Error accepting match:', error); throw error; @@ -73,7 +73,7 @@ export const useMatchesService = () => { const rejectMatch = async (matchId: string): Promise => { try { - await api.post(`${API_VERSION}/matching/rsvp/${matchId}/reject`); + await api.get(`${API_VERSION}/matching/rsvp/${matchId}/reject`); } catch (error) { console.error('Error rejecting match:', error); throw error;