-
Notifications
You must be signed in to change notification settings - Fork 605
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
Add update database to client #170
Conversation
src/api-endpoints.ts
Outdated
extends DatabasesUpdatePathParameters, | ||
DatabasesUpdateQueryParameters, | ||
DatabasesUpdateBodyParameters {} | ||
export interface DatabasesUpdateResponse extends BlockBase {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns a Database
object right? not BlockBase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Response
type needs to be updated and remove the non updatable property schema types
@@ -1040,3 +1040,28 @@ export interface LastEditedTimePropertySchema { | |||
export interface LastEditedByPropertySchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not part of the PR, but why is this a PropertySchema
? this shouldn't be editable right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for | CreatedTimePropertySchema | CreatedByPropertySchema | LastEditedTimePropertySchema | LastEditedByPropertySchema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these can be added to the database schema as properties, the values themselves are not updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see, sg!
src/api-types.ts
Outdated
} | ||
|
||
export interface UpdateMultiSelectPropertySchema { | ||
multi_select: { options?: UpdateMultiSelectOptionSchema[] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a separate type for the mulitselect options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point - updated so both use the same type
type UpdateSelectOptionSchema = SelectOptionSchema | SelectOption | ||
|
||
export interface UpdateSelectPropertySchema { | ||
select: { options?: UpdateSelectOptionSchema[] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the options
field is nullable? what's the behavior when an empty object is passed into select
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's undefined, then there will be no options (similar to when you create a "select" property in the client before adding any options). In create database, the options
are optional (ha).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, question about the behavior of an empty select
field
* Add update database to client * Fix typo * Change response to Database * Use the same type for both select and multi select options
Adding support for update database: https://developers.notion.com/reference/update-a-database