refusals.ts
This file
Path
apps/web/src/features/shared/refusals.ts
10 lines · 358 bytes · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
1234567891011import { Refusal } from "@repo/protocol/refusal";import { notFound } from "@tanstack/react-router";import { Effect, Schema } from "effect";
export const Refusals = Schema.NonEmptyArray(Refusal);
export const notFoundFor = (refusal: Refusal) => Effect.flatMap(Schema.encodeEffect(Refusals)([refusal]), (data) => Effect.fail(notFound({ data })) );