Got content added to new pages.

This commit is contained in:
2025-05-02 18:04:17 -04:00
parent 57a09461f1
commit ea825c89eb
7 changed files with 47 additions and 14 deletions

View File

@ -132,7 +132,13 @@ impl MoreThanText {
reply.get_data("sess_id").unwrap().to_uuid().unwrap()
}
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply
pub fn get_document<S>(
&self,
sess_id: Uuid,
action: ActionType,
doc_name: S,
data: String,
) -> MTTReply
where
S: Into<String>,
{
@ -140,7 +146,7 @@ impl MoreThanText {
msg.add_data("sess_id", sess_id);
msg.add_data("action", action);
msg.add_data("name", doc_name.into());
msg.add_data("doc", "splat");
msg.add_data("doc", data);
let rx = self.client_channel.send(msg);
let reply = rx.recv().unwrap();
MTTReply::new(reply)
@ -176,7 +182,7 @@ mod mtt {
fn get_root_document_with_str() {
let mut mtt = MoreThanText::new();
let id = mtt.validate_session(Some(Uuid::new_v4()));
let output = mtt.get_document(id, ActionType::Get, "root");
let output = mtt.get_document(id, ActionType::Get, "root", "".to_string());
assert!(output.get_error().is_none());
}
@ -184,7 +190,7 @@ mod mtt {
fn get_root_document_with_string() {
let mut mtt = MoreThanText::new();
let id = mtt.validate_session(Some(Uuid::new_v4()));
let output = mtt.get_document(id, ActionType::Get, "root".to_string());
let output = mtt.get_document(id, ActionType::Get, "root".to_string(), "".to_string());
assert!(output.get_error().is_none());
}
}