fix: fix the internal server error with "'" in blog post slugs
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m4s
This commit is contained in:
parent
912815ae30
commit
91153e1ad4
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue