Skip to content

Commit 37f3bbe

Browse files
nit
1 parent b230c86 commit 37f3bbe

File tree

1 file changed

+7
-10
lines changed
  • packages/web/src/app/api/(server)/[...slug]

1 file changed

+7
-10
lines changed
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { ErrorCode } from "@/lib/errorCodes"
2-
import { ServiceError } from "@/lib/serviceError"
2+
import { serviceErrorResponse } from "@/lib/serviceError"
33
import { StatusCodes } from "http-status-codes"
4-
import { NextResponse } from "next/server"
54

6-
// Repeat for other methods or use a handler:
7-
const handler = () => NextResponse.json(
8-
{
5+
const handler = () => {
6+
return serviceErrorResponse({
97
statusCode: StatusCodes.NOT_FOUND,
108
errorCode: ErrorCode.NOT_FOUND,
119
message: "This API endpoint does not exist",
12-
} satisfies ServiceError,
13-
{ status: 404 }
14-
)
15-
16-
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE }
10+
});
11+
}
12+
13+
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE }

0 commit comments

Comments
 (0)