Skip to content

Commit

Permalink
fix: check body to be undefined (#31)
Browse files Browse the repository at this point in the history
In case body is undefined, replace with empty text

Co-authored-by: Sebastian Holmqvist <csholmq@users.noreply.github.com>
  • Loading branch information
csholmq and csholmq committed Sep 16, 2021
1 parent 1833d36 commit 0679843
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/notion.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/notion.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const notionApi = async (apiKey: string, database_id: string) => {
},
body: {
rich_text: [
{ text: { content: body }, type: 'text' }
{ text: { content: (body != undefined) ? body : '' }, type: 'text' }
],
type: 'rich_text'
}
Expand Down Expand Up @@ -97,7 +97,7 @@ const notionApi = async (apiKey: string, database_id: string) => {
},
body: {
rich_text: [
{ text: { content: body }, type: 'text' }
{ text: { content: (body != undefined) ? body : '' }, type: 'text' }
],
type: 'rich_text'
}
Expand Down

0 comments on commit 0679843

Please sign in to comment.