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

Reading a "Person" property from a database entry returns only the first result #478

Open
aDogCalledSpot opened this issue Dec 4, 2023 · 0 comments

Comments

@aDogCalledSpot
Copy link

aDogCalledSpot commented Dec 4, 2023

Describe the bug
Fetching a "Persons" property from a database entry (e.g. "Assignees") returns only the first person as an object instead of returning a list of people.

Setting the property strangely enough demands a list of people instead of just a single value (which is more in line with the expected behavior).

To Reproduce
Node version: ts-node version 10.9.1
Notion JS library version: 2.2.13

Steps to reproduce the behavior:

  • Create a database
  • Add a property "Assignees" of type "Person"
const response = await notion.pages.properties.retrieve({
        page_id: pageId,
        property_id: "Assignees"
    }) as any;
    console.log(response.results);

returns

[
  {
    object: 'property_item',
    type: 'people',
    id: 'Assignees',
    people: { object: 'user', id: 'abcdefdeadbeef123' }
// no array ^-----------------------------------------^
  }
]

Expected behavior

[
  {
    object: 'property_item',
    type: 'people',
    id: 'Assignees',
    people: [{ object: 'user', id: 'abcdefdeadbeef123' }]
// array ---^-------------------------------------------^
  }
]
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