1
0

fix(home): explicitly use filter for tasks on home page when one is set

Resolves https://github.com/go-vikunja/vikunja/issues/289
Resolves https://community.vikunja.io/t/various-sorting-filtering-issues/2781/5

(cherry picked from commit 97e030a1fc032c73ca6144139a488c18979fb310)
This commit is contained in:
kolaente
2024-09-12 15:51:04 +02:00
parent c9f47797cf
commit f1451abebe
3 changed files with 16 additions and 5 deletions

View File

@ -31,9 +31,17 @@ export default class TaskCollectionService extends AbstractService<ITask> {
constructor() {
super({
getAll: '/projects/{projectId}/views/{viewId}/tasks',
// /projects/{projectId}/tasks when viewId is not provided
})
}
getReplacedRoute(path: string, pathparams: Record<string, unknown>): string {
if (!pathparams.viewId) {
return super.getReplacedRoute('/projects/{projectId}/tasks', pathparams)
}
return super.getReplacedRoute(path, pathparams)
}
modelFactory(data) {
// FIXME: There must be a better way for this…
if (typeof data.project_view_id !== 'undefined') {