Added corrections to user profile and admin match and game history
This commit is contained in:
@@ -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,
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user