SyntaxSquad/DADProject#15 feat: Added Multiplayer View and Stuff
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user