mirror of https://github.com/buster-so/buster.git
fix: add report type support to collection REST endpoints
- Add 'report' case to add_assets_to_collection endpoint - Add 'report' case to remove_assets_from_collection endpoint - Update error response mappings to include ReportFile type
This commit is contained in:
parent
13a1d38437
commit
7229faea25
|
@ -66,6 +66,7 @@ pub async fn add_assets_to_collection(
|
|||
let asset_type = match asset.type_.to_lowercase().as_str() {
|
||||
"dashboard" => Some(AssetType::DashboardFile),
|
||||
"metric" => Some(AssetType::MetricFile),
|
||||
"report" => Some(AssetType::ReportFile),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
@ -81,6 +82,7 @@ pub async fn add_assets_to_collection(
|
|||
let type_str = match asset_type {
|
||||
AssetType::DashboardFile => "dashboard",
|
||||
AssetType::MetricFile => "metric",
|
||||
AssetType::ReportFile => "report",
|
||||
_ => "unknown",
|
||||
};
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ pub async fn remove_assets_from_collection(
|
|||
match asset.type_.to_lowercase().as_str() {
|
||||
"dashboard" => Some(AssetToRemove::Dashboard(asset.id)),
|
||||
"metric" => Some(AssetToRemove::Metric(asset.id)),
|
||||
"report" => Some(AssetToRemove::Report(asset.id)),
|
||||
_ => None,
|
||||
}
|
||||
}).collect();
|
||||
|
@ -77,6 +78,7 @@ pub async fn remove_assets_from_collection(
|
|||
let type_str = match asset_type {
|
||||
AssetType::DashboardFile => "dashboard",
|
||||
AssetType::MetricFile => "metric",
|
||||
AssetType::ReportFile => "report",
|
||||
_ => "unknown",
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue