Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { api, throttle } from '@/utils';
- const actions = {
- setEvents({ commit }, payload) {
- throttle(function* () {
- const { zip, radius } = payload;
- yield api.get('/events/general')
- .then(response => commit('SET_GENERAL_EVENTS', response.data)
- .catch(catchError);
- yield api.get(`/events/zip/${zip}`, { params: { radius } })
- .then(response => commit('SET_ZIP_EVENTS', response.data))
- .catch(catchError);
- yield api.get(`/events/students/zip/${zip}`, { params: { radius } })
- .then(response => commit('SET_STUDENT_EVENTS', response.data))
- .catch(catchError);
- })
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement