SyntaxSquad/DADProject#15 feat: Added Multiplayer View and Stuff

This commit is contained in:
AfonsoCMSousa
2026-01-02 19:07:27 +00:00
parent 5880960c42
commit 5e90de812b
9 changed files with 529 additions and 504 deletions
+10 -5
View File
@@ -56,14 +56,19 @@ const getPendingGames = async (mode = selectedMode.value) => {
if (gLoading.value) return;
gLoading.value = true;
apiStore.gameQueryParameters.page = gPage.value++;
apiStore.gameQueryParameters.filters.sort_direction = "asc"
apiStore.gameQueryParameters.filters.type = mode
apiStore.gameQueryParameters.filters.status = 'Pending'
try {
const response = await apiStore.getGames();
const response = await axios.get(`${API_BASE_URL}/games/open`, {
params: {
type: mode,
page: gPage.value
}
});
const newGames = response.data.data;
openGames.value = [...openGames.value, ...newGames];
gPage.value++;
} catch (error) {
console.error('Failed to fetch games:', error);
} finally {
gLoading.value = false;
}