This commit is contained in:
2025-11-28 17:22:21 +08:00
parent 59dd79308b
commit 07f4155c2c
2 changed files with 3 additions and 3 deletions

View File

@@ -239,7 +239,7 @@ export async function fetchRemotePost(
slug: string,
): Promise<NotionPost | null> {
try {
const res = await fetch(`${POSTS_API_URL}/${slug}`)
const res = await fetch(`https://notion-api.nvme0n1p.dev/v2/posts/${slug}`)
if (!res.ok) throw new Error(`Failed to fetch post: ${res.status}`)
const data = (await res.json()) as NotionPost
return data

View File

@@ -1,11 +1,11 @@
import { POSTS_API_URL } from '../data-utils'
import type { Post } from '../interfaces'
export async function getPostByPageId(pageId: string): Promise<Post | null> {
if (!pageId) return null
try {
const res = await fetch(POSTS_API_URL)
const res = await fetch("https://notion-api.nvme0n1p.dev/v2/posts")
if (!res.ok) throw new Error(`Failed to fetch posts: ${res.status}`)
const payload = (await res.json()) as { posts?: any[] }