feat: improve structure and error handling
This commit is contained in:
@@ -5,15 +5,15 @@ import type { NextRequest } from "next/server"
|
||||
export const runtime = "edge"
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
console.log({ GET_REQ: req })
|
||||
console.log({ GET_AUTH_URL: process.env.AUTH_URL })
|
||||
console.log({ GET_NEXTAUTH_URL: process.env.NEXTAUTH_URL })
|
||||
// console.log({ GET_REQ: req })
|
||||
// console.log({ GET_AUTH_URL: process.env.AUTH_URL })
|
||||
// console.log({ GET_NEXTAUTH_URL: process.env.NEXTAUTH_URL })
|
||||
return _GET(req)
|
||||
}
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
console.log({ POST_REQ: req })
|
||||
console.log({ POST_AUTH_URL: process.env.AUTH_URL })
|
||||
console.log({ POST_NEXTAUTH_URL: process.env.NEXTAUTH_URL })
|
||||
// console.log({ POST_REQ: req })
|
||||
// console.log({ POST_AUTH_URL: process.env.AUTH_URL })
|
||||
// console.log({ POST_NEXTAUTH_URL: process.env.NEXTAUTH_URL })
|
||||
return _POST(req)
|
||||
}
|
||||
|
||||
@@ -64,8 +64,7 @@ export async function POST(request: NextRequest) {
|
||||
data: { content_type, entry },
|
||||
},
|
||||
} = validatedData
|
||||
const identifier = entry.url ?? content_type.uid
|
||||
const refsTag = generateRefsResponseTag(entry.locale, identifier)
|
||||
const refsTag = generateRefsResponseTag(entry.locale, entry.uid)
|
||||
const refTag = generateRefTag(entry.locale, content_type.uid, entry.uid)
|
||||
const tag = generateTag(entry.locale, entry.uid)
|
||||
|
||||
@@ -81,7 +80,7 @@ export async function POST(request: NextRequest) {
|
||||
if (entry.breadcrumbs) {
|
||||
const breadcrumbsRefsTag = generateRefsResponseTag(
|
||||
entry.locale,
|
||||
identifier,
|
||||
entry.uid,
|
||||
breadcrumbsAffix
|
||||
)
|
||||
const breadcrumbsTag = generateTag(
|
||||
|
||||
Reference in New Issue
Block a user