完成BlogApi
This commit is contained in:
11
tone-page-web/lib/api/blog/get.ts
Normal file
11
tone-page-web/lib/api/blog/get.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Blog } from "@/lib/types/blog";
|
||||
import fetcher from "../fetcher";
|
||||
|
||||
export async function get(id: string) {
|
||||
return fetcher<{
|
||||
id: string;
|
||||
title: string;
|
||||
createdAt: string;
|
||||
content: string;
|
||||
}>(`/api/blog/${id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user