mirror of https://github.com/buster-so/buster.git
now returns yml in the raw messages
This commit is contained in:
parent
c90c6fc62f
commit
0d3f1589c1
|
@ -142,8 +142,9 @@ pub async fn restore_chat_handler(
|
|||
.select(metric_files::content)
|
||||
.first::<serde_json::Value>(&mut conn)
|
||||
.await?;
|
||||
// Convert JSON Value to String
|
||||
content_json.to_string()
|
||||
// Convert JSON Value to pretty YAML String
|
||||
serde_yaml::to_string(&content_json)
|
||||
.map_err(|e| anyhow!("Failed to convert metric content to YAML: {}", e))?
|
||||
}
|
||||
AssetType::DashboardFile => {
|
||||
let content_json = dashboard_files::table
|
||||
|
@ -151,8 +152,9 @@ pub async fn restore_chat_handler(
|
|||
.select(dashboard_files::content)
|
||||
.first::<serde_json::Value>(&mut conn)
|
||||
.await?;
|
||||
// Convert JSON Value to String for the message
|
||||
content_json.to_string()
|
||||
// Convert JSON Value to pretty YAML String for the message
|
||||
serde_yaml::to_string(&content_json)
|
||||
.map_err(|e| anyhow!("Failed to convert dashboard content to YAML: {}", e))?
|
||||
}
|
||||
// This case should be unreachable due to the check in the restore_task
|
||||
_ => {
|
||||
|
|
Loading…
Reference in New Issue