feat(app): auth, orgs/events UI, router guards, and dev tooling
- Add Sanctum auth flow (store, composables, login, axios interceptors) - Add dashboard, organisation list/detail, events CRUD dialogs - Wire router guards, navigation, organisation switcher in layout - Replace Vuexy @db types in NavSearchBar; add @iconify/types; themeConfig title typing - Vuetify settings.scss + resolve configFile via fileURLToPath; drop dead path aliases - Root index redirects to dashboard; fix events table route name - API: DevSeeder + DatabaseSeeder updates; docs TEST_SCENARIO; corporate identity assets Made-with: Cursor
This commit is contained in:
35
apps/app/src/stores/useOrganisationStore.ts
Normal file
35
apps/app/src/stores/useOrganisationStore.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const ACTIVE_ORG_KEY = 'crewli_active_org'
|
||||
const ACTIVE_EVENT_KEY = 'crewli_active_event'
|
||||
|
||||
export const useOrganisationStore = defineStore('organisation', () => {
|
||||
const activeOrganisationId = ref<string | null>(localStorage.getItem(ACTIVE_ORG_KEY))
|
||||
const activeEventId = ref<string | null>(localStorage.getItem(ACTIVE_EVENT_KEY))
|
||||
|
||||
function setActiveOrganisation(id: string) {
|
||||
activeOrganisationId.value = id
|
||||
localStorage.setItem(ACTIVE_ORG_KEY, id)
|
||||
}
|
||||
|
||||
function setActiveEvent(id: string) {
|
||||
activeEventId.value = id
|
||||
localStorage.setItem(ACTIVE_EVENT_KEY, id)
|
||||
}
|
||||
|
||||
function clear() {
|
||||
activeOrganisationId.value = null
|
||||
activeEventId.value = null
|
||||
localStorage.removeItem(ACTIVE_ORG_KEY)
|
||||
localStorage.removeItem(ACTIVE_EVENT_KEY)
|
||||
}
|
||||
|
||||
return {
|
||||
activeOrganisationId,
|
||||
activeEventId,
|
||||
setActiveOrganisation,
|
||||
setActiveEvent,
|
||||
clear,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user