improvement: make state res actually work
This commit is contained in:
@@ -23,7 +23,7 @@ pub async fn set_global_account_data_route(
|
||||
) -> ConduitResult<set_global_account_data::Response> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let content = serde_json::from_str::<serde_json::Value>(body.data.get())
|
||||
let data = serde_json::from_str(body.data.get())
|
||||
.map_err(|_| Error::BadRequest(ErrorKind::BadJson, "Data is invalid."))?;
|
||||
|
||||
let event_type = body.event_type.to_string();
|
||||
@@ -33,10 +33,7 @@ pub async fn set_global_account_data_route(
|
||||
sender_user,
|
||||
event_type.clone().into(),
|
||||
&BasicEvent {
|
||||
content: CustomEventContent {
|
||||
event_type,
|
||||
json: content,
|
||||
},
|
||||
content: CustomEventContent { event_type, data },
|
||||
},
|
||||
&db.globals,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user