Skip to content

Commit

Permalink
SMA-102: updated index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ivamach committed Apr 13, 2024
1 parent c1ed9bb commit 206e119
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions frontend/sportsmatch-app/src/pages/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EventsControllerService,
ExSecuredEndpointService,
OpenAPI,
RequestEventDTO,
SportDTO,
} from '../generated/api'
import useModal from '../hooks/UseModal'
Expand Down Expand Up @@ -52,14 +51,13 @@ export default function MainPage() {

useEffect(() => {
const fetchData = async () => {
OpenAPI.TOKEN = localStorage.getItem('token')!
try {
const requestEventDTO: RequestEventDTO = {
sportsName: selectedSports,
}
const response = await EventsControllerService.getNearbyEvents(
requestEventDTO,
{},
selectedSports,
0,
0,
0,
5,
)
if (!Array.isArray(response)) {
throw new Error('Failed to fetch event data')
Expand Down

0 comments on commit 206e119

Please sign in to comment.