Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. beforeRouteEnter(from, to, next) {
  2. const promises = [];
  3. if (!store.getters['teams/value']) {
  4. promises.push(store.dispatch('teams/GET'));
  5. }
  6. if (!store.getters['users_masks/value']) {
  7. promises.push(store.dispatch('users_masks/GET'));
  8. }
  9. if (!store.getters['categories/value']) {
  10. promises.push(store.dispatch('users_masks/GET'));
  11. }
  12. if (!store.getters['statusv2/value']) {
  13. promises.push(store.dispatch('statusv2/GET'));
  14. }
  15. if (!store.getters['companiesv2/value']) {
  16. promises.push(store.dispatch('companiesv2/GET'));
  17. }
  18. Promise.all(promises).then(() => {
  19. next();
  20. }).catch(() => {
  21. });
  22. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement