chore: migrate OG image generation API to App Router (#19568)

* migrate

* improve apiRouteMiddleware wrapper type

* refactor

* fix type check

* fix build

* fix

* Do not import stripe lib in getServerErrorFromUnknown

* address comment

* remove comment

* add url

* keep the location

* remove space

* add unit test for getServerErrorFromUnknown

* improve

* fix
This commit is contained in:
Benny Joo authored and GitHub committed 2025-02-28 11:03:20 +01:00
1 parent c1ef57e3c2
commit 87f161d944
2 files changed
+15 -15

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ import { NextResponse } from "next/server";
import { getServerErrorFromUnknown } from "@calcom/lib/server/getServerErrorFromUnknown";
export const apiRouteMiddleware =
(handler: (req: NextRequest, { params }: { params: Params }) => Promise<NextResponse>) =>
(handler: (req: NextRequest, { params }: { params: Params }) => Promise<NextResponse | Response>) =>
async (req: NextRequest, { params }: { params: Params }) => {
try {
return await handler(req, { params });