Comments (3)
To add on this, the backend validation prevents you to pass it by bypassing the type safety.
One (inconvenient) workaround is to create the toggle, get it's id, then use append block children api call to add the table as its children.
here's a typescript example
const notion = getNotionClient();
await notion.blocks.children.append({
block_id: myBlockId,
children: [
{
table: {
table_width: 3,
children: [{ table_row: { cells: [
[{ text: { content: 'u' } }],
[{ text: { content: 'wot' } }],
[{ text: { content: 'm8' } }]
]}}]
}
}
]
});
Edit: after reading the small print carefully, it looks like it's a limitation of the api as mentioned in the link I provided:
from notion-sdk-js.
@Rustytard thanks for reporting. v2.2.14 should fix the type issue you raised.
from notion-sdk-js.
To add on this, the backend validation prevents you to pass it by bypassing the type safety.
One (inconvenient) workaround is to create the toggle, get it's id, then use append block children api call to add the table as its children.
here's a typescript example
const notion = getNotionClient(); await notion.blocks.children.append({ block_id: myBlockId, children: [ { table: { table_width: 3, children: [{ table_row: { cells: [ [{ text: { content: 'u' } }], [{ text: { content: 'wot' } }], [{ text: { content: 'm8' } }] ]}}] } } ] });Edit: after reading the small print carefully, it looks like it's a limitation of the api as mentioned in the link I provided:
I did the workaroud through different function as you mentioned. This flow looks clunky but who will argue if in result the goal is achieved.Thank you!)
from notion-sdk-js.
Related Issues (20)
- In version 2.2.13: QueryDatabaseResponse response types include PartialDatabaseObjectResponse | DatabaseObjectResponse HOT 1
- Map over database results union type HOT 3
- `users.me` types refuse `auth` parameter
- DatabaseObjectResponse ts missing title
- Replace node-fetch with isomorphic-fetch HOT 3
- The attribute `name` in database properties is not respected
- I am experiencing difficulties logging into Notion on the Windows platform. This issue seems to be affecting the login process, preventing me from accessing my Notion workspace HOT 1
- DatabasePropertyConfigResponse is a local type HOT 2
- Reading a "Person" property from a database entry returns only the first result
- Notion Formula Has a Bug Regarding Time Formatting HOT 3
- npm install ERR! for 'parse-text-from-any-block-type' examples
- How do I get value from blocks.retrieve
- The `punycode` module is deprecated HOT 3
- Missing `request_id` type in `OauthTokenResponse`
- unable to add external to files HOT 1
- multi_select type bug HOT 1
- Error: Insufficient permissions for this endpoint.
- I found the Mar 22, 2024 bug. I caused the problem HOT 5
- NotionS
- Inconsistent type: Cursor for parameters is string|undefined but for responses is string|null HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notion-sdk-js.