fix: changed String option to &'a str

This commit is contained in:
Bram Dingelstad 2023-03-19 23:20:43 +01:00
parent 46d1bc9b3f
commit 11016250c6

View file

@ -170,11 +170,10 @@ impl BlockChildren {
pub struct Databases { pub struct Databases {
http_client: Rc<reqwest::Client>, http_client: Rc<reqwest::Client>,
// token: String
} }
impl Databases { impl Databases {
pub async fn query(self, options: DatabaseQueryOptions) -> Result<QueryResponse<Page>> { pub async fn query<'a>(self, options: DatabaseQueryOptions<'a>) -> Result<QueryResponse<Page>> {
let url = format!("https://api.notion.com/v1/databases/{database_id}/query", database_id = options.database_id); let url = format!("https://api.notion.com/v1/databases/{database_id}/query", database_id = options.database_id);
let mut request = self.http_client let mut request = self.http_client
@ -199,9 +198,10 @@ impl Databases {
} }
} }
pub struct DatabaseQueryOptions { pub struct DatabaseQueryOptions<'a> {
pub database_id: String, pub database_id: &'a str,
pub filter: Option<Value> // TODO: Implement spec for filter // TODO: Implement spec for filter?
pub filter: Option<Value>
} }