General: use node-fetch to post notes

This commit is contained in:
2024-07-28 01:07:35 +01:00
parent 0addaa0d7f
commit 426f05dfbd
2 changed files with 37 additions and 22 deletions

View File

@@ -82,7 +82,8 @@ export async function uploadCommandGeneral(
const upload = new Upload2NotionGeneral(plugin, dbDetails);
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
if (res.status === 200) {
const { response } = res;
if (response.status === 200) {
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
} else {
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
@@ -120,7 +121,7 @@ export async function uploadCommandCustom(
if (response.status === 200) {
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
} else {
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
}
}