Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The attribute name in database properties is not respected #473

Open
IxDay opened this issue Nov 27, 2023 · 0 comments
Open

The attribute name in database properties is not respected #473

IxDay opened this issue Nov 27, 2023 · 0 comments

Comments

@IxDay
Copy link

IxDay commented Nov 27, 2023

Describe the bug
When using notion.databases.create if you pass a property with a name different from the ID it is not respected and name is taking ID value

To Reproduce
Node version: 20.4.0
Notion JS library version: 2.2.7

Steps to reproduce the behavior:

create a database with the following code:

const payload = {
  parent: {
    type: "page_id",
    page_id: pageId,
  },
  is_inline: true,
  title: [
    {
      type: "text",
      text: {
        content: "Catalog",
      },
    },
  ],
  properties: {
    Foo: {
      name: "Bar",
      rich_text: {},
      type: "rich_text",
    },
    Name: {
      title: {},
    },
  },
}
const response = await notion.databases.create(payload)
console.log(util.inspect(response, {showHidden: false, depth: null, colors: true}))

You will notice that name returned from the API is now Foo and that UI matches this.

Expected behavior
The name attribute is respected from the API and properly matching in the UI

Screenshots
Please include any screenshots that help explain your problem.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant