Update
This commit is contained in:
parent
ff11781e11
commit
f6ecd49565
1 changed files with 0 additions and 27 deletions
27
src/lib.rs
27
src/lib.rs
|
@ -662,33 +662,6 @@ impl Client {
|
||||||
to: &chrono::NaiveDate,
|
to: &chrono::NaiveDate,
|
||||||
department: Option<i32>,
|
department: Option<i32>,
|
||||||
) -> Result<Vec<RpcSubstitution>> {
|
) -> Result<Vec<RpcSubstitution>> {
|
||||||
println!(
|
|
||||||
"{}",
|
|
||||||
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<Vec<RpcSubstitution>> = reqwest::Client::new()
|
let resp: RpcResponse<Vec<RpcSubstitution>> = reqwest::Client::new()
|
||||||
.get(self.rpc_url.as_str())
|
.get(self.rpc_url.as_str())
|
||||||
.header(reqwest::header::USER_AGENT, &self.user_agent)
|
.header(reqwest::header::USER_AGENT, &self.user_agent)
|
||||||
|
|
Loading…
Reference in a new issue