Files
tonePage/tone-page-web/lib/api/blog/get.ts

13 lines
330 B
TypeScript

import fetcher from "../fetcher";
export async function get(id: string, option: {
password?: string;
} = {}) {
const { password } = option;
return fetcher<{
id: string;
title: string;
createdAt: string;
content: string;
}>(`/api/blog/${id}` + (password ? `?p=${password}` : ''));
}