1
0

chore: export not archived root projects

This commit is contained in:
kolaente
2023-04-01 11:15:12 +02:00
parent 0be83db40f
commit b5d9afd0f7
2 changed files with 5 additions and 3 deletions

View File

@ -29,6 +29,8 @@ 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 notArchivedRootProjects = computed(() => projectsArray.value
.filter(p => p.parentProjectId === 0 && !p.isArchived))
const hasProjects = computed(() => projects.value ? true : false)
const getProjectById = computed(() => {
@ -200,6 +202,7 @@ export const useProjectStore = defineStore('project', () => {
isLoading: readonly(isLoading),
projects: readonly(projects),
projectsArray: readonly(projectsArray),
notArchivedRootProjects: readonly(notArchivedRootProjects),
hasProjects: readonly(hasProjects),
getProjectById,
@ -235,7 +238,7 @@ export function useProject(projectId: MaybeRef<IProject['id']>) {
)
const projectStore = useProjectStore()
const parentProject = ref<IProject | null>(null)
watch(
() => project.parentProjectId,