Reworked workspaces store

This commit is contained in:
Julien Nahum
2023-12-19 18:57:31 +01:00
parent aac4d1da04
commit 5640f43b9d
17 changed files with 210 additions and 282 deletions

View File

@@ -42,7 +42,8 @@
<script>
import ForgotPasswordModal from '../ForgotPasswordModal.vue'
import {opnFetch} from "~/composables/useOpnApi.js";
import {opnFetch} from "~/composables/useOpnApi.js"
import {fetchAllWorkspaces} from "~/stores/workspaces.js"
export default {
name: 'LoginForm',
@@ -58,9 +59,9 @@ export default {
},
setup () {
const authStore = useAuthStore()
return {
authStore
authStore: useAuthStore(),
workspaceStore: useWorkspacesStore()
}
},
@@ -84,6 +85,9 @@ export default {
const userData = await opnFetch('user')
this.authStore.setUser(userData)
const workspaces = await fetchAllWorkspaces()
this.workspaceStore.set(workspaces.data.value)
// Redirect home.
this.redirect()
},