aboutsummaryrefslogtreecommitdiff
path: root/src/models/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/search.rs')
-rw-r--r--src/models/search.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/models/search.rs b/src/models/search.rs
index aa2f62e..3e5d782 100644
--- a/src/models/search.rs
+++ b/src/models/search.rs
@@ -1,5 +1,6 @@
+use crate::ids::{PageId, UserId};
use crate::models::paging::Paging;
-use crate::models::{Number, PageId, UserId};
+use crate::models::Number;
use chrono::{DateTime, Utc};
use serde::ser::SerializeMap;
use serde::{Serialize, Serializer};
@@ -281,8 +282,10 @@ pub struct DatabaseSort {
// Todo: Should property and timestamp be mutually exclusive? (i.e a flattened enum?)
// the documentation is not clear:
// https://developers.notion.com/reference/post-database-query#post-database-query-sort
+ #[serde(skip_serializing_if = "Option::is_none")]
pub property: Option<String>,
/// The name of the timestamp to sort against.
+ #[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<DatabaseSortTimestamp>,
pub direction: SortDirection,
}