diff --git a/frontend/static/js/api/tournament/Tournaments.js b/frontend/static/js/api/tournament/Tournaments.js index 2b31811..eed0092 100644 --- a/frontend/static/js/api/tournament/Tournaments.js +++ b/frontend/static/js/api/tournament/Tournaments.js @@ -67,7 +67,8 @@ class Tourmanents tournament_data.started, tournament_data.finished, tournament_data.levels, - tournament_data.id)); + tournament_data.id, + tournament_data.state)); }); return tournaments; diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 6193116..7c3856e 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -15,7 +15,7 @@ import SettingsView from "./views/SettingsView.js"; import ProfilePageView from "./views/ProfilePageView.js"; import MatchMakingView from "./views/MatchMakingView.js"; import TournamentPageView from "./views/tournament/TournamentPageView.js"; -import TournamentsView from "./views/tournament/TournamentsListView.js"; +import TournamentsListView from "./views/tournament/TournamentsListView.js"; import TournamentCreateView from "./views/tournament/TournamentCreateView.js"; import AuthenticationView from "./views/accounts/AuthenticationView.js"; import TicTacToeView from "./views/TicTacToeView.js"; @@ -82,7 +82,7 @@ const router = async(uri) => { { path: "/profiles/:username", view: ProfilePageView }, { path: "/tournaments/create", view: TournamentCreateView }, { path: "/tournaments/:id", view: TournamentPageView }, - { path: "/tournaments/", view: TournamentsView }, + { path: "/tournaments/", view: TournamentsListView }, { path: "/login", view: AuthenticationView }, { path: "/register", view: AuthenticationView }, { path: "/logout", view: LogoutView }, diff --git a/tournament/viewset.py b/tournament/viewset.py index 0ffd2cd..5106928 100644 --- a/tournament/viewset.py +++ b/tournament/viewset.py @@ -43,7 +43,7 @@ class TournamentViewSet(viewsets.ModelViewSet): query = TournamentModel.objects.filter(started=False, finished=False) case _: query = TournamentModel.objects.all() - serializer = TournamentSerializer(query, many=True) + serializer = self.serializer_class(query, many=True) return Response(serializer.data) def retrieve(self, request: HttpRequest, pk):