chore: export favorite projects from store
This commit is contained in:
parent
336db56316
commit
131022da42
@ -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.
|
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
|
const favoriteProjects = computed(() => projectStore.favoriteProjects
|
||||||
.filter(p => !p.isArchived && p.isFavorite)
|
|
||||||
.sort((a, b) => a.position - b.position))
|
.sort((a, b) => a.position - b.position))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
const projectsArray = computed(() => Object.values(projects.value))
|
const projectsArray = computed(() => Object.values(projects.value))
|
||||||
const notArchivedRootProjects = computed(() => projectsArray.value
|
const notArchivedRootProjects = computed(() => projectsArray.value
|
||||||
.filter(p => p.parentProjectId === 0 && !p.isArchived))
|
.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 hasProjects = computed(() => projects.value ? true : false)
|
||||||
|
|
||||||
const getProjectById = computed(() => {
|
const getProjectById = computed(() => {
|
||||||
@ -203,6 +205,7 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
projects: readonly(projects),
|
projects: readonly(projects),
|
||||||
projectsArray: readonly(projectsArray),
|
projectsArray: readonly(projectsArray),
|
||||||
notArchivedRootProjects: readonly(notArchivedRootProjects),
|
notArchivedRootProjects: readonly(notArchivedRootProjects),
|
||||||
|
favoriteProjects: readonly(favoriteProjects),
|
||||||
hasProjects: readonly(hasProjects),
|
hasProjects: readonly(hasProjects),
|
||||||
|
|
||||||
getProjectById,
|
getProjectById,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user