mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 17:39:46 +01:00
Add basic analytics
This commit is contained in:
@@ -74,7 +74,7 @@ async fn send_ephemeral_request(
|
||||
db_instance: State<'_, Mutex<Pool<Sqlite>>>,
|
||||
) -> Result<models::HttpResponse, String> {
|
||||
let pool = &*db_instance.lock().await;
|
||||
let response = models::HttpResponse::default();
|
||||
let response = models::HttpResponse::new();
|
||||
let environment_id2 = environment_id.unwrap_or("n/a").to_string();
|
||||
request.id = "".to_string();
|
||||
return actually_send_request(request, &response, &environment_id2, &app_handle, pool).await;
|
||||
|
||||
@@ -118,6 +118,15 @@ pub struct HttpResponse {
|
||||
pub headers: Json<Vec<HttpResponseHeader>>,
|
||||
}
|
||||
|
||||
impl HttpResponse {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
model: "http_response".to_string(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(sqlx::FromRow, Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
pub struct KeyValue {
|
||||
|
||||
Reference in New Issue
Block a user