From c992579931206d126aff12b61d222611e17673a1 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 15 Jan 2025 06:01:48 +0100 Subject: [PATCH] fix api route --- src/app/article/[...slug]/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/article/[...slug]/page.tsx b/src/app/article/[...slug]/page.tsx index 00c9113..41512ab 100644 --- a/src/app/article/[...slug]/page.tsx +++ b/src/app/article/[...slug]/page.tsx @@ -13,11 +13,12 @@ import "@/app/index.css" import { Post } from "@/models"; import { Attributes } from "@sequelize/core"; import { DeepPartial } from "@/util/deeppartial"; +import { constructAPIUrl } from "@/util/url/urlConstructor"; async function getData(slug:string):Promise> { // Get all posts from the API - const res = await fetch(`http://localhost:3000/api/post/${slug}`); + const res = await fetch(await constructAPIUrl(`post/${slug}`)); // The return value is *not* serialized // You can return Date, Map, Set, etc. // Recommendation: handle errors