Files
liam-portfolio/src/app/(payload)/api/[...slug]/route.ts
T
LiamPietralla d34a8474fc
Build and Push Container / Build App (pull_request) Successful in 1m54s
Build and Push Container / Build App (push) Successful in 2m0s
Build and Push Container / Publish App (pull_request) Skipped
Build and Push Container / Publish App (push) Skipped
format fix
2026-10-15 17:28:40 +11:00

44 lines
1.1 KiB
TypeScript

/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import config from '@payload-config'
import '@payloadcms/next/css'
import {
REST_DELETE,
REST_GET,
REST_OPTIONS,
REST_PATCH,
REST_POST,
REST_PUT,
} from '@payloadcms/next/routes'
type NextCtx = { params: Promise<{ slug?: string[] }> }
type PayloadCtx = { params: Promise<{ slug: string[] }> }
const coerceCtx = (ctx: NextCtx): PayloadCtx => ({
params: ctx.params.then((p) => ({ slug: p?.slug ?? [] })),
})
export function GET(req: Request, ctx: NextCtx) {
return REST_GET(config)(req, coerceCtx(ctx))
}
export function POST(req: Request, ctx: NextCtx) {
return REST_POST(config)(req, coerceCtx(ctx))
}
export function DELETE(req: Request, ctx: NextCtx) {
return REST_DELETE(config)(req, coerceCtx(ctx))
}
export function PATCH(req: Request, ctx: NextCtx) {
return REST_PATCH(config)(req, coerceCtx(ctx))
}
export function PUT(req: Request, ctx: NextCtx) {
return REST_PUT(config)(req, coerceCtx(ctx))
}
export function OPTIONS(req: Request, ctx: NextCtx) {
return REST_OPTIONS(config)(req, coerceCtx(ctx))
}