import { NOTION_KEY } from "../config"; const { Client } = require("@notionhq/client"); export const notion = new Client({ auth: NOTION_KEY }); export type DatabaseType = "laws" | "advice"; /** * Translates incoming GET parameters into a valid block ID. * @param type * @returns string */ export function getDatabaseId(type: DatabaseType): string | undefined { switch (type) { case "laws": return "d02fa51eda254c9fa4b97e5f9beb1a86"; case "advice": return "9515c0f02e454e968c44336bd1beb463"; default: return undefined; } }