import { t } from "@repo/core-shared/trpc/init";
import { defineErrorMiddleware } from "@repo/core-shared/trpc/define-error-middleware";

import { PageNotFoundError } from "../../entities/errors/page";
import { InputParseError } from "../../entities/errors/common";

export const marketingPagesProcedure = t.procedure.use(
  defineErrorMiddleware([
    [InputParseError, "BAD_REQUEST"],
    [PageNotFoundError, "NOT_FOUND"],
  ]),
);
