Closed alexliebh closed 2 years ago
After proxying the Request sent out by the client, it seems that the color is indeed included but the Notion API doesn't seem to care for it. Weird.
{
"parent": {
"database_id": "x"
},
"properties": {
"Category": {
"select": {
"name": "Cultural",
"color": "orange"
}
},
"City": {
"select": {
"name": "Brussels",
"color": "blue"
}
},
"Closed": {
"checkbox": false
},
"Description": {
"rich_text": [
{
"text": {
"content": "À travers des expositions thématiques annuelles, le Musée Mode & Dentelle présente des pièces significatives de l’histoire de la mode tout en mettant l’accent sur la création bruxelloise et belge."
}
}
]
},
"Email": {
"type": "email",
"email": "musea@brucity.be"
},
"Locality": {
"select": {
"name": "Bruxelles",
"color": "blue"
}
},
"Name": {
"title": [
{
"text": {
"content": "Musée Mode & Dentelle"
}
}
]
},
"Opening Days": {
"multi_select": [
{
"name": "Mardi",
"color": "purple"
},
{
"name": "Mercredi",
"color": "purple"
},
{
"name": "Jeudi",
"color": "purple"
},
{
"name": "Vendredi",
"color": "purple"
},
{
"name": "Samedi",
"color": "purple"
},
{
"name": "Dimanche",
"color": "purple"
}
]
},
"Opening Hours": {
"rich_text": [
{
"text": {
"content": "10:00-17:00"
}
}
]
},
"Openings": {
"rich_text": [
{
"text": {
"content": "mar - dim: 10:00 - 17:00"
}
}
]
},
"Phone": {
"phone_number": "02 213 44 50"
},
"Train Station": {
"select": {
"name": "Bruxelles-Central",
"color": "blue"
}
},
"URL": {
"url": "https://www.museumpassmusees.be/fr/offre/musee/959e91f7-94b9-4cb6-95f2-b814bbe57074/musee-mode-amp-dentelle"
},
"Website": {
"type": "url",
"url": "http://www.fashionandlacemuseum.brussels"
}
},
"icon": {
"type": "emoji",
"emoji": "☸️"
},
"cover": {
"type": "external",
"external": {
"url": "https://media.museumpassmusees.be/d5baa098-aebb-414f-bd55-50358def63a8?max-h=600&max-w=1500"
}
}
}
I will take a look at reporting it to the Notion team but I'll leave the issue open in case you have any idea to fix this?
Cheers anyway!
Sorry for the late reply. Thanks for the kind words! Looking that the Notion API docs, the description of the color
property says:
"Not currently editable."
So I believe it's correct that you cannot set a color for a select option when creating/updating pages/blocks.
At the moment notion.SelectOptions
is used for create/update request data, so I guess it's a bit confusing because you could easily think that color
is a valid property when creating/updating select options. Having separate types for upserting and reading select options would clear this up, but I think it's not worth the hassle of maintaining a bunch of extra types. So closing this issue for now.
I thoroughly enjoy using your client, it makes a lot of sense when you get the hang of it. Unfortunately, I have been struggling with something that doesn't seem to stem from my code (feel free to contradict using the code provided below). When creating a new
Page
in aDatabase
, I add a fewSelect
properties withSelectOptions
while filling theColor
andName
fields. The API doesn't seem to receive theColor
information though and theOptions
appear a different color every time in the Notion interface. This leads to the inability to add any more Pages due to the inconsistent colors.I scoured the Notion API Interface and the docs of this API but I didn't seem to find any note about this.
In this specific example,
City
,Locality
,Category
,Opening Days
, andTrain Station
are always random colors and I cannot seem to be able to set them.The resulting error doesn't really matter but I'll stick it in here in case you can learn more from it than I can :^)
If you have any quick fixes for this, it would be absolutely amazing. Thank you in advance