Sha256: 044e6e2f7937421c40a12ae451abba4c980efe83964823f48246a141cfbbbefc
Contents?: true
Size: 1.58 KB
Versions: 11
Compression:
Stored size: 1.58 KB
Contents
import Vue from 'vue' import Router from 'vue-router' import imageListing from '../components/imageListing.vue' import imageShow from '../components/imageShow.vue' import store from '../stores' Vue.use(Router) let router = new Router({ routes: [ { path: '/', name: 'root', component: imageListing, beforeEnter: (to, from, next) => { store.dispatch('mediasStore/clearImgListing') next() } }, { path: '/show/:id', name: 'showImage', component: imageShow, beforeEnter: (to, from, next) => { store.dispatch('overlayStore/showProgressOverlay', true) store.dispatch('mediasStore/fetchSingleImage', to.params.id) .then(() => { store.dispatch('overlayStore/showProgressOverlay', false) next() }) .catch((e) => { store.dispatch('overlayStore/showProgressOverlay', false); }) } }, { path: '/new/', name: 'createImage', component: imageShow, beforeEnter: (to, from, next) => { store.dispatch('overlayStore/showProgressOverlay', true) store.dispatch('mediasStore/clearCurrentImg') store.dispatch('mediasStore/checkAddMediaPermission').then(()=> { store.dispatch('overlayStore/showProgressOverlay', false) next() }).catch(() => { store.dispatch('overlayStore/showProgressOverlay', false) store.dispatch('overlayStore/pushNotification', {error: true, msg: `Vous n'avez pas les permissions d'ajouter un media`}, {root:true}) }) } } ] }) export default router
Version data entries
11 entries across 11 versions & 1 rubygems