From 5f0d931d8044f743ada4af35aa76457fc7692c06 Mon Sep 17 00:00:00 2001 From: Dominic Grimm Date: Thu, 23 Feb 2023 19:53:11 +0100 Subject: [PATCH] Update --- src/lib.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8329daa..1617878 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -662,6 +662,32 @@ impl Client { to: &chrono::NaiveDate, department: Option, ) -> Result> { + dbg!( + reqwest::Client::new() + .get(self.rpc_url.as_str()) + .header(reqwest::header::USER_AGENT, &self.user_agent) + .header(reqwest::header::CONTENT_TYPE, "application/json") + .header(reqwest::header::ACCEPT, "application/json") + .header( + reqwest::header::COOKIE, + self.session.as_ref().context("Not logged in")?, + ) + .json(&json!({ + "id": "ID", + "method": "getSubstitutions", + "params": { + "startDate": serialize_date(*from), + "endDate": serialize_date(*to), + "departmentId": department.map_or(0, |d| d) + }, + "jsonrpc": "2.0" + })) + .send() + .await? + .text() + .await? + ); + let resp: RpcResponse> = reqwest::Client::new() .get(self.rpc_url.as_str()) .header(reqwest::header::USER_AGENT, &self.user_agent)