Skip to content

Commit

Permalink
fix: new notion relation requires new properties
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoluiz authored and jomei committed Jul 3, 2023
1 parent b0a0b47 commit 069db92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,8 @@ const (
TemplateMentionTypeUser TemplateMentionType = "template_mention_user"
TemplateMentionTypeDate TemplateMentionType = "template_mention_date"
)

const (
RelationSingleProperty RelationConfigType = "single_property"
RelationDualProperty RelationConfigType = "dual_property"
)
19 changes: 16 additions & 3 deletions property_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,23 @@ type RelationPropertyConfig struct {
Relation RelationConfig `json:"relation"`
}

type RelationConfigType string

func (rp RelationConfigType) String() string {
return string(rp)
}

type SingleProperty struct{}

type DualProperty struct{}

type RelationConfig struct {
DatabaseID DatabaseID `json:"database_id"`
SyncedPropertyID PropertyID `json:"synced_property_id"`
SyncedPropertyName string `json:"synced_property_name"`
DatabaseID DatabaseID `json:"database_id"`
SyncedPropertyID PropertyID `json:"synced_property_id,omitempty"`
SyncedPropertyName string `json:"synced_property_name,omitempty"`
Type RelationConfigType `json:"type,omitempty"`
SingleProperty *SingleProperty `json:"single_property,omitempty"`
DualProperty *DualProperty `json:"dual_property,omitempty"`
}

func (p RelationPropertyConfig) GetType() PropertyConfigType {
Expand Down

0 comments on commit 069db92

Please sign in to comment.