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)
|
.select(metric_files::content)
|
||||||
.first::<serde_json::Value>(&mut conn)
|
.first::<serde_json::Value>(&mut conn)
|
||||||
.await?;
|
.await?;
|
||||||
// Convert JSON Value to String
|
// Convert JSON Value to pretty YAML String
|
||||||
content_json.to_string()
|
serde_yaml::to_string(&content_json)
|
||||||
|
.map_err(|e| anyhow!("Failed to convert metric content to YAML: {}", e))?
|
||||||
}
|
}
|
||||||
AssetType::DashboardFile => {
|
AssetType::DashboardFile => {
|
||||||
let content_json = dashboard_files::table
|
let content_json = dashboard_files::table
|
||||||
|
@ -151,8 +152,9 @@ pub async fn restore_chat_handler(
|
||||||
.select(dashboard_files::content)
|
.select(dashboard_files::content)
|
||||||
.first::<serde_json::Value>(&mut conn)
|
.first::<serde_json::Value>(&mut conn)
|
||||||
.await?;
|
.await?;
|
||||||
// Convert JSON Value to String for the message
|
// Convert JSON Value to pretty YAML String for the message
|
||||||
content_json.to_string()
|
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
|
// This case should be unreachable due to the check in the restore_task
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Reference in New Issue