Files
karakeep-mirror/packages/shared/utils/switch.ts
Mohamed Bassem 62f7d900c5 feat: Add tag search and pagination (#1987)
* feat: Add tag search and use in the homepage

* use paginated query in the all tags view

* wire the load more buttons

* add skeleton to all tags page

* fix attachedby aggregation

* fix loading states

* fix hasNextPage

* use action buttons for load more buttons

* migrate the tags auto complete to the search api

* Migrate the tags editor to the new search API

* Replace tag merging dialog with tag auto completion

* Merge both search and list APIs

* fix tags.list

* add some tests for the endpoint

* add relevance based sorting

* change cursor

* update the REST API

* fix review comments

* more fixes

* fix lockfile

* i18n

* fix visible tags
2025-09-28 11:03:48 +01:00

7 lines
122 B
TypeScript

export function switchCase<T extends string | number, R>(
value: T,
cases: Record<T, R>,
) {
return cases[value];
}