Stash changes

This commit is contained in:
2024-03-02 09:14:27 +00:00
parent f08397ab15
commit ac049beff7
4 changed files with 23 additions and 5 deletions
+6 -1
View File
@@ -2,7 +2,10 @@ use reqwest::Client;
use serde_json::Value;
use std::collections::HashMap;
use std::time::Duration;
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use hyper::HeaderMap;
use migration::cli::Cli;
use tracing::instrument;
use tracing::log::debug;
use crate::toggl_api::types::{Current, Project, ProjectClient, ReportEntry, TogglQuery};
@@ -22,7 +25,9 @@ impl TogglApiClient {
true
}
pub fn new(workspace_id: &str, toggl_auth: &str) -> Self {
pub fn new(workspace_id: &str, api_token: &str) -> Self {
let toggl_auth = &STANDARD.encode(&format!("{}:api_token", api_token));
let client = Client::builder()
.default_headers(Self::default_headers(toggl_auth))
.build()