mirror of
https://github.com/wahyd4/badger.git
synced 2026-08-09 05:15:58 +10:00
24 lines
436 B
JavaScript
24 lines
436 B
JavaScript
export const state = () => ({
|
|
stats: []
|
|
});
|
|
|
|
export const mutations = {
|
|
setStats(state, stats) {
|
|
state.stats = stats;
|
|
}
|
|
};
|
|
|
|
export const actions = {
|
|
async getBadgeStats(context, {badgeId, callback, errorCallback}) {
|
|
try{
|
|
const result = await this.$axios.$get(`/api/stats/${badgeId}`);
|
|
context.commit("setStats", result);
|
|
callback(result);
|
|
}catch (error) {
|
|
errorCallback(error)
|
|
}
|
|
|
|
}
|
|
|
|
};
|