Skip to content

Commit 5734585

Browse files
committed
Remove deprecated PropertyFilter and CompoundFilter from database query
1 parent d674a41 commit 5734585

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

database.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,27 +139,13 @@ type DatabaseListResponse struct {
139139
}
140140

141141
type DatabaseQueryRequest struct {
142-
// Deprecated: use Filter instead
143-
PropertyFilter *PropertyFilter
144-
// Deprecated: use Filter instead
145-
CompoundFilter *CompoundFilter
146-
147142
Filter Filter
148143
Sorts []SortObject `json:"sorts,omitempty"`
149144
StartCursor Cursor `json:"start_cursor,omitempty"`
150145
PageSize int `json:"page_size,omitempty"`
151146
}
152147

153148
func (qr *DatabaseQueryRequest) MarshalJSON() ([]byte, error) {
154-
var filter interface{}
155-
switch {
156-
case qr.PropertyFilter != nil:
157-
filter = qr.PropertyFilter
158-
case qr.CompoundFilter != nil:
159-
filter = qr.CompoundFilter
160-
case qr.Filter != nil:
161-
filter = qr.Filter
162-
}
163149
return json.Marshal(struct {
164150
Sorts []SortObject `json:"sorts,omitempty"`
165151
StartCursor Cursor `json:"start_cursor,omitempty"`
@@ -169,7 +155,7 @@ func (qr *DatabaseQueryRequest) MarshalJSON() ([]byte, error) {
169155
Sorts: qr.Sorts,
170156
StartCursor: qr.StartCursor,
171157
PageSize: qr.PageSize,
172-
Filter: filter,
158+
Filter: qr.Filter,
173159
})
174160
}
175161

0 commit comments

Comments
 (0)