vikunja-frontend/src/helpers/savedFilter.ts
2022-04-02 17:16:58 +02:00

10 lines
No EOL
245 B
TypeScript

import ListModel from '@/models/list'
export function getSavedFilterIdFromListId(listId: ListModel['id']) {
let filterId = listId * -1 - 1
// FilterIds from listIds are always positive
if (filterId < 0) {
filterId = 0
}
return filterId
}