refactor: move from union type to object enum
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Task } from "@/model/task";
|
||||
import { filterTasks, type TaskFilter } from "./filterTasks";
|
||||
import { groupTasks, type GroupBy, type TaskGroup } from "./groupTasks";
|
||||
import { GroupBy } from "./groupBy";
|
||||
import { groupTasks, type TaskGroup } from "./groupTasks";
|
||||
|
||||
export type DashboardViewOptions = {
|
||||
filter?: TaskFilter;
|
||||
@@ -19,7 +20,7 @@ export function buildDashboardView(
|
||||
options: DashboardViewOptions = {},
|
||||
): DashboardView {
|
||||
const filter = options.filter ?? {};
|
||||
const groupBy = options.groupBy ?? "none";
|
||||
const groupBy = options.groupBy ?? GroupBy.NONE;
|
||||
|
||||
const visibleTasks = filterTasks(tasks, filter);
|
||||
const groups = groupTasks(visibleTasks, groupBy);
|
||||
|
||||
Reference in New Issue
Block a user