chore: export favorite projects from store
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-04-01 11:18:11 +02:00
parent e3a4f87988
commit 08e2a44b20
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 2 deletions

View File

@ -24,8 +24,7 @@ const projects = computed({
},
set() { }, // Vue will complain about the component not being writable - but we never need to write here. The setter is only here to silence the warning.
})
const favoriteProjects = computed(() => projectStore.projectsArray
.filter(p => !p.isArchived && p.isFavorite)
const favoriteProjects = computed(() => projectStore.favoriteProjects
.sort((a, b) => a.position - b.position))
</script>

View File

@ -31,6 +31,8 @@ export const useProjectStore = defineStore('project', () => {
const projectsArray = computed(() => Object.values(projects.value))
const notArchivedRootProjects = computed(() => projectsArray.value
.filter(p => p.parentProjectId === 0 && !p.isArchived))
const favoriteProjects = computed(() => projectsArray.value
.filter(p => !p.isArchived && p.isFavorite))
const hasProjects = computed(() => projects.value ? true : false)
const getProjectById = computed(() => {
@ -203,6 +205,7 @@ export const useProjectStore = defineStore('project', () => {
projects: readonly(projects),
projectsArray: readonly(projectsArray),
notArchivedRootProjects: readonly(notArchivedRootProjects),
favoriteProjects: readonly(favoriteProjects),
hasProjects: readonly(hasProjects),
getProjectById,