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:
dal 2025-08-22 10:15:12 -06:00
parent 13a1d38437
commit 7229faea25
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 4 additions and 0 deletions

View File

@ -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",
};

View File

@ -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",
};