Files
homarr/apps/nextjs/src/components/board/items/actions/remove-item.ts
T

13 lines
296 B
TypeScript

import type { Board } from "~/app/[locale]/boards/_types";
export interface RemoveItemInput {
itemId: string;
}
export const removeItemCallback =
({ itemId }: RemoveItemInput) =>
(board: Board): Board => ({
...board,
items: board.items.filter((item) => item.id !== itemId),
});