Skip to content

Commit 52e4f1e

Browse files
authored
Sync api-endpoints: support templates in Update Page (#631)
## Description This PR adds support for two new optional parameters in the `UpdatePageBodyParameters`: - `erase_content`: boolean to clear all current children of the page - `template`: either `{ type: "default" }` or `{ type: "template_id"; template_id: IdRequest }` to specify a template to apply onto an existing page (template content is appended, and properties are merged the same way as for `pages.create`) ## How was this change tested? - [ ] Automated test (unit, integration, etc.) - [x] Manual test (provide reproducible testing steps below) Automated file sync; no manual code changes in this PR. Relying on typechecking and existing tests in CI. ## Screenshots N/A
1 parent 5a6ed64 commit 52e4f1e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/api-endpoints.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,6 +3588,13 @@ type UpdatePageBodyParameters = {
35883588
// Whether the page should be locked from editing in the Notion app UI. If not provided,
35893589
// the locked state will not be updated.
35903590
is_locked?: boolean
3591+
template?:
3592+
| { type: "default" }
3593+
| { type: "template_id"; template_id: IdRequest }
3594+
// Whether to erase all existing content from the page. When used with a template, the
3595+
// template content replaces the existing content. When used without a template, simply
3596+
// clears the page content.
3597+
erase_content?: boolean
35913598
archived?: boolean
35923599
in_trash?: boolean
35933600
}
@@ -3609,6 +3616,8 @@ export const updatePage = {
36093616
"icon",
36103617
"cover",
36113618
"is_locked",
3619+
"template",
3620+
"erase_content",
36123621
"archived",
36133622
"in_trash",
36143623
],

0 commit comments

Comments
 (0)