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, 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. + diff --git a/client/src/services/matchesService.ts b/client/src/services/matchesService.ts index 5ff9fa10..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/match/${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/match/${matchId}/reject`); + await api.get(`${API_VERSION}/matching/rsvp/${matchId}/reject`); } catch (error) { console.error('Error rejecting match:', error); throw error;