Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import { api, throttle } from '@/utils';
  2.  
  3. const actions = {
  4.  
  5. setEvents({ commit }, payload) {
  6. throttle(function* () {
  7. const { zip, radius } = payload;
  8.  
  9. yield api.get('/events/general')
  10. .then(response => commit('SET_GENERAL_EVENTS', response.data)
  11. .catch(catchError);
  12.  
  13. yield api.get(`/events/zip/${zip}`, { params: { radius } })
  14. .then(response => commit('SET_ZIP_EVENTS', response.data))
  15. .catch(catchError);
  16.  
  17. yield api.get(`/events/students/zip/${zip}`, { params: { radius } })
  18. .then(response => commit('SET_STUDENT_EVENTS', response.data))
  19. .catch(catchError);
  20. })
  21. },
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement