Add notion icon remove no use code

This commit is contained in:
chris
2022-05-24 13:11:29 +08:00
parent a437eba782
commit 917d2f943d
3 changed files with 30 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
import { App, requestUrl } from "obsidian";
import { requestUrl } from "obsidian";
import { Client } from "@notionhq/client";
import { markdownToBlocks, markdownToRichText } from "@tryfabric/martian";
import { markdownToBlocks, } from "@tryfabric/martian";
import * as fs from "fs";
import * as yamlFrontMatter from "yaml-front-matter";
import * as yaml from "yaml"
@@ -13,10 +13,11 @@ export class Upload2Notion {
constructor(app: MyPlugin) {
this.app = app;
}
async createPage(title:string, childArr: any) {
const bodyString = {
"parent": { "database_id": this.app.settings.databaseID },
parent: {
database_id: this.app.settings.databaseID
},
properties: {
Name: {
title: [
@@ -35,7 +36,7 @@ export class Upload2Notion {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'User-Agent': 'obsidian.md',
// 'User-Agent': 'obsidian.md',
'Authorization': 'Bearer ' + this.app.settings.notionAPI,
'Notion-Version': '2021-08-16',
},