assign default values for all projects

This commit is contained in:
isUnknown 2025-10-08 15:03:27 +02:00
parent fb1a86712d
commit cde0eb1943

View file

@ -15,15 +15,19 @@ export const useProjectsStore = defineStore('projects', () => {
});
const draftProjects = computed(() => {
return projects.value
.filter((project) => project.status === 'draft')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
return (
projects.value
?.filter((project) => project.status === 'draft')
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) ?? []
);
});
const archivedProjects = computed(() => {
return projects.value
.filter((project) => project.status === 'unlisted')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
return (
projects.value
?.filter((project) => project.status === 'unlisted')
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) ?? []
);
});
const api = useApiStore();