27 lines
545 B
JavaScript
Raw Permalink Normal View History

2020-09-30 20:57:12 +02:00
import axios from 'axios';
export const state = () => ({
cache: []
});
export const mutations = {
update(state, data) {
state.cache = data;
},
};
export const actions = {
2020-10-02 18:09:51 +02:00
update(context) {
2020-09-30 20:57:12 +02:00
axios.post("/api", {
request: "fetch_alltime_cache"
})
//axios.get("/rest-dummies/cache.json", {
//})
2020-09-30 20:57:12 +02:00
.then(function(response) {
if (response.data.status === "OK") {
2020-10-02 18:09:51 +02:00
context.commit("update", response.data.cache);
2020-09-30 20:57:12 +02:00
}
});
},
};