|
@@ -1,15 +1,7 @@
|
1
|
1
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
2
|
2
|
import type { NextApiRequest, NextApiResponse } from "next";
|
3
|
|
-import { DatabaseType, getDatabaseId, notion } from "../../lib/notion";
|
4
|
|
-
|
5
|
|
-interface Topic {
|
6
|
|
- blockId: string;
|
7
|
|
- name: string;
|
8
|
|
-}
|
9
|
|
-
|
10
|
|
-interface Error {
|
11
|
|
- status: string;
|
12
|
|
-}
|
|
3
|
+import { getDatabaseId, notion } from "../../lib/notion";
|
|
4
|
+import { DatabaseType, Error, Topic } from "../../types";
|
13
|
5
|
|
14
|
6
|
function getTopicsInDatabase(notionResp: any): Topic[] {
|
15
|
7
|
return notionResp.results.map((block: any) => ({
|