这是错误:
客户端警告:请求失败{代码:'validation_error',消息:'正文验证失败。修复一:应该定义 body.properties.body.id,而不是undefined。body.properties.body.name 应该被定义,而不是undefined。body.properties.body.start 应该被定义,而不是undefined。' 主体验证失败。修复一:应该定义 body.properties.body.id,而不是undefined。body.properties.body.name 应该被定义,而不是undefined。body.properties.body.start 应该被定义,而不是undefined
这是我的代码:
async function update() {
const res_2 = await notion.databases.query({ database_id: `${databaseId}` });
res_2.results.forEach(async (page, index) => {
let property_id = page.properties.Excerpt.id;
if (index === 0) {
try {
const res_3 = await notion.pages.update({
page_id: page.id,
properties: {
[property_id]: {
type: "rich_text",
rich_text: {
"content": "hey"
}
}
}
})
} catch (err) {
console.log(err.message)
}
}
})
}
update(); …Run Code Online (Sandbox Code Playgroud)