WIP: fix: don't try to load a task view with the id of the list #1252

Closed
konrad wants to merge 1 commits from fix/load-task-as-list into main
1 changed files with 7 additions and 0 deletions

View File

@ -524,6 +524,13 @@ export default {
},
computed: {
taskId() {
// This ensures we're actually dealing with a task route and not trying to load a task with the id of
// its list. When closing the modal, this watcher gets triggered because the route param of the list
// route is also called "id".
if (!this.$route.name.startsWith('task')) {
return undefined
}
const {id} = this.$route.params
Review

Maybe a better fix would be to rename the param in the router config to something like taskId?

Maybe a better fix would be to rename the param in the router config to something like `taskId`?
Review

Yes that makes sense. I do actually already the opposite in the modal branch:
I renamed the list id param in listId. E.g. 43c935ca41/src/router/index.ts (L263)

Yes that makes sense. I do actually already the opposite in the modal branch: I renamed the list id param in `listId`. E.g. https://kolaente.dev/dpschen/frontend/src/commit/43c935ca4141de6f85bb22c959b730a4e7d04854/src/router/index.ts#L263
Review

So this PR will probably get obsolete once we merge the modal one?

So this PR will probably get obsolete once we merge the modal one?
Review

I think so, yes

I think so, yes
Review

Okay, I'll set this to wip until the other one is merged so we don't accedentially merge this.

Okay, I'll set this to wip until the other one is merged so we don't accedentially merge this.
return id === undefined ? id : Number(id)
},