feat: unify savedFilter logic in service (#2491)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2491 Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:

committed by
konrad

parent
9ded3d0cd6
commit
9807858436
@ -1,14 +0,0 @@
|
||||
import type {IList} from '@/modelTypes/IList'
|
||||
|
||||
export function getSavedFilterIdFromListId(listId: IList['id']) {
|
||||
let filterId = listId * -1 - 1
|
||||
// FilterIds from listIds are always positive
|
||||
if (filterId < 0) {
|
||||
filterId = 0
|
||||
}
|
||||
return filterId
|
||||
}
|
||||
|
||||
export function isSavedFilter(list: IList) {
|
||||
return getSavedFilterIdFromListId(list.id) > 0
|
||||
}
|
Reference in New Issue
Block a user