Changed how the data is tokenised
This commit is contained in:
+3
-1
@@ -20,6 +20,7 @@ use crate::
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct DataToSend {
|
||||
pub id: u32,
|
||||
pub action_type: String,
|
||||
pub content: String,
|
||||
pub character: String,
|
||||
@@ -53,7 +54,7 @@ pub async fn api_process
|
||||
// Perform this code on a GET request
|
||||
.map(|state: Arc<Mutex<DataToSend>>, tx_handle: Sender<(bool,usize,String)>|
|
||||
{
|
||||
debug!("GET: {state:?}");
|
||||
//debug!("GET: {state:?}");
|
||||
let reply = state.as_ref();
|
||||
let _ = tx_handle.send((true,0,String::new()));
|
||||
warp::reply::json(&reply) // Send the reply data (data_to_send formatted as JSON)
|
||||
@@ -126,6 +127,7 @@ pub fn modify_data
|
||||
)
|
||||
{
|
||||
let mut data = data_to_send.lock().unwrap_or_exit("Data to send Mutex was poisoned",2); // TODO eh?
|
||||
data.id += 1;
|
||||
data.action_type = action_type;
|
||||
data.content = content;
|
||||
data.character = character_name;
|
||||
|
||||
Reference in New Issue
Block a user