fix: fix the internal server error with "'" in blog post slugs
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s

This commit is contained in:
Dorian Niemiec 2024-11-08 10:48:01 +01:00
parent 912815ae30
commit 91153e1ad4

View file

@ -26,7 +26,7 @@ import { Button } from "@/components/ui/button";
async function getData(slug: string) { async function getData(slug: string) {
const query = ` const query = `
*[_type == "blog" && slug.current == '${slug}'] { *[_type == "blog" && slug.current == '${slug.replace(/\'/g, "\\'")}'] {
"currentSlug": slug.current, "currentSlug": slug.current,
title, title,
content, content,