Added corrections to user profile and admin match and game history

This commit is contained in:
2026-01-03 00:41:24 +00:00
parent 1a7916a836
commit 894a38bb27
6 changed files with 1240 additions and 706 deletions
+17 -1
View File
@@ -174,9 +174,24 @@ export const useAPIStore = defineStore('api', () => {
...(params.sort_direction == 'asc' && { sort_direction: 'asc' }),
...(params.type && { type: params.type }),
}).toString()
return axios.get(`${API_BASE_URL}/games?${queryParams}`)
}
const getAdminMatches = (params = {}) => {
const queryParams = new URLSearchParams({
page: params.page || 1,
...(params.type && { type: params.type }),
...(params.outcome && { outcome: params.outcome }),
...(params.date_from && { date_from: params.date_from }),
...(params.date_to && { date_to: params.date_to }),
sort_by: params.sort_by || 'began_at',
sort_direction: params.sort_direction || 'desc',
}).toString()
return axios.get(`${API_BASE_URL}/matches?${queryParams}`)
}
const postAdmin = async (credentials) => {
return axios.post(`${API_BASE_URL}/admin/users`, credentials)
}
@@ -199,7 +214,8 @@ export const useAPIStore = defineStore('api', () => {
deleteUser,
getAdminTransactions,
getAdminGames,
getAdminMatches,
postAdmin,
gameQueryParameters,
}
})
})