api: updated returned message specifiers

This commit is contained in:
Nickiel12 2022-12-22 13:23:52 -08:00
parent 3535da9a39
commit 388c26fdc8
2 changed files with 3 additions and 2 deletions

View file

@ -81,6 +81,6 @@ fn main() {
let msg = socket.read_message().expect("Error reading message"); let msg = socket.read_message().expect("Error reading message");
let resp: message_types::ServerResponse = let resp: message_types::ServerResponse =
serde_json::from_str(msg.into_text().unwrap().as_str()).unwrap(); serde_json::from_str(msg.into_text().unwrap().as_str()).unwrap();
println!("recieved: {:?}", resp); println!("recieved: {:?}\n{:?}", resp.message, resp.search_results);
socket.close(None).unwrap(); socket.close(None).unwrap();
} }

View file

@ -73,8 +73,9 @@ impl PartialTag {
} }
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize)]
pub struct ServerResponse { pub struct ServerResponse {
pub message: String,
pub search_results: Vec<ItemTag>, pub search_results: Vec<ItemTag>,
} }