1
0

chore: export projects as array directly from projects store

This commit is contained in:
kolaente
2023-03-28 15:36:31 +02:00
parent 2bb7ff1803
commit e4379f0a22
3 changed files with 5 additions and 4 deletions

View File

@ -28,7 +28,7 @@ export const useProjectStore = defineStore('project', () => {
// The projects are stored as an object which has the project ids as keys.
const projects = ref<ProjectState>({})
const projectsArray = computed(() => Object.values(projects.value))
const getProjectById = computed(() => {
return (id: IProject['id']) => typeof projects.value[id] !== 'undefined' ? projects.value[id] : null
@ -180,6 +180,7 @@ export const useProjectStore = defineStore('project', () => {
return {
isLoading: readonly(isLoading),
projects: readonly(projects),
projectsArray: readonly(projectsArray),
getProjectById,
findProjectByExactname,