From 7229faea25c044e7e3a4cac52f28ce590ff90f60 Mon Sep 17 00:00:00 2001 From: dal Date: Fri, 22 Aug 2025 10:15:12 -0600 Subject: [PATCH] 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 --- .../routes/rest/routes/collections/add_assets_to_collection.rs | 2 ++ .../rest/routes/collections/remove_assets_from_collection.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/api/server/src/routes/rest/routes/collections/add_assets_to_collection.rs b/apps/api/server/src/routes/rest/routes/collections/add_assets_to_collection.rs index e13a5de7c..9184cecb0 100644 --- a/apps/api/server/src/routes/rest/routes/collections/add_assets_to_collection.rs +++ b/apps/api/server/src/routes/rest/routes/collections/add_assets_to_collection.rs @@ -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", }; diff --git a/apps/api/server/src/routes/rest/routes/collections/remove_assets_from_collection.rs b/apps/api/server/src/routes/rest/routes/collections/remove_assets_from_collection.rs index e257d9995..dd10a61e2 100644 --- a/apps/api/server/src/routes/rest/routes/collections/remove_assets_from_collection.rs +++ b/apps/api/server/src/routes/rest/routes/collections/remove_assets_from_collection.rs @@ -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", };