Register router after Pinia store
Created by: deepakduggirala
We're unable to use Pinia stores inside router.beforeEach
because router is created before pinia stores in ui/src/main.js
, ui/src/router/index.js
.
Create router after the line app.use(createPinia())
.
Problems with using ToastStore in services were also observed when tweaking router/index.js - https://github.com/IUSCA/bioloop/issues/68
PS:
ui/src/services/api.js
imports router. router.push
can be replaced with window.location.href