feat: implement SEO enhancements, automatic slug generation, and font optimizations
All checks were successful
Build and Push App / build (push) Successful in 9m12s
All checks were successful
Build and Push App / build (push) Successful in 9m12s
This commit is contained in:
@@ -27,6 +27,10 @@ export async function PATCH(
|
||||
try {
|
||||
const { id } = await context.params
|
||||
const body = await request.json()
|
||||
if (body.title && body.slug === undefined) {
|
||||
const { generateSlug } = await import('@/lib/utils')
|
||||
body.slug = generateSlug(body.title)
|
||||
}
|
||||
const post = await prisma.blogPost.update({ where: { id }, data: body })
|
||||
return NextResponse.json(post)
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user