restore document deletion routes

This commit is contained in:
mpostma 2021-09-24 15:21:07 +02:00
parent c32012c44a
commit b9d189bf12
5 changed files with 68 additions and 75 deletions

View file

@ -95,6 +95,8 @@ pub struct Stats {
#[derive(derivative::Derivative)]
#[derivative(Debug)]
pub enum Update {
DeleteDocuments(Vec<String>),
ClearDocuments,
Settings(Settings<Unchecked>),
DocumentAddition {
#[derivative(Debug="ignore")]

View file

@ -49,12 +49,14 @@ pub fn create_update_handler(
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum RegisterUpdate {
DeleteDocuments(Vec<String>),
DocumentAddition {
primary_key: Option<String>,
method: IndexDocumentsMethod,
content_uuid: Uuid,
},
Settings(Settings<Unchecked>),
ClearDocuments,
}
/// A wrapper type to implement read on a `Stream<Result<Bytes, Error>>`.
@ -210,6 +212,8 @@ impl UpdateLoop {
}
}
Update::Settings(settings) => RegisterUpdate::Settings(settings),
Update::ClearDocuments => RegisterUpdate::ClearDocuments,
Update::DeleteDocuments(ids) => RegisterUpdate::DeleteDocuments(ids),
};
let store = self.store.clone();