diff --git a/meilisearch-http/src/routes/dump.rs b/meilisearch-http/src/routes/dump.rs index cbf89ddea..849b8c654 100644 --- a/meilisearch-http/src/routes/dump.rs +++ b/meilisearch-http/src/routes/dump.rs @@ -1,8 +1,10 @@ -use actix_web::{web, HttpResponse}; +use actix_web::{web, HttpRequest, HttpResponse}; use log::debug; use meilisearch_lib::MeiliSearch; use serde::{Deserialize, Serialize}; +use serde_json::json; +use crate::analytics::Analytics; use crate::error::ResponseError; use crate::extractors::authentication::{policies::*, GuardedData}; @@ -13,7 +15,11 @@ pub fn configure(cfg: &mut web::ServiceConfig) { pub async fn create_dump( meilisearch: GuardedData, + req: HttpRequest, + analytics: web::Data<&'static dyn Analytics>, ) -> Result { + analytics.publish("Dump Created".to_string(), json!({}), Some(&req)); + let res = meilisearch.create_dump().await?; debug!("returns: {:?}", res);