Skip to content

Commit

Permalink
Merge pull request #8 from atcol/patch-1
Browse files Browse the repository at this point in the history
feat: filter convenience fn for pages
  • Loading branch information
b3ngg authored Oct 26, 2024
2 parents dd4e556 + 3a3888c commit f1cfc16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/models/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,21 @@ pub enum NotionSearch {
}

impl NotionSearch {
/// Convenience function for building a filter for `Database`s
pub fn filter_by_databases() -> Self {
Self::Filter {
property: FilterProperty::Object,
value: FilterValue::Database,
}
}

/// Convenience function for building a filter for `Page`s
pub fn filter_by_pages() -> Self {
Self::Filter {
property: FilterProperty::Object,
value: FilterValue::Page,
}
}
}

impl From<NotionSearch> for SearchRequest {
Expand Down

0 comments on commit f1cfc16

Please # to comment.