From e83a00c108926a352f24a9258f8fe5c60e2d8f2a Mon Sep 17 00:00:00 2001 From: dal Date: Thu, 9 Jan 2025 16:18:11 -0700 Subject: [PATCH] Add data source information to GetDataset response structure --- .../rest/routes/datasets/get_dataset.rs | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/api/src/routes/rest/routes/datasets/get_dataset.rs b/api/src/routes/rest/routes/datasets/get_dataset.rs index 9b8a687ff..0e9d0d25c 100644 --- a/api/src/routes/rest/routes/datasets/get_dataset.rs +++ b/api/src/routes/rest/routes/datasets/get_dataset.rs @@ -36,6 +36,9 @@ pub struct GetDatasetResponse { pub name: String, pub sql: Option, pub yml_file: Option, + pub data_source_name: String, + pub data_source_type: String, + pub data_source_id: Uuid, } pub async fn get_dataset( @@ -88,7 +91,18 @@ async fn get_dataset_handler(dataset_id: &Uuid, user: &User) -> Result Result, Option)>(&mut conn) + .first::<( + Uuid, + String, + String, + Option, + Option, + String, + String, + Uuid, + )>(&mut conn) .await { Ok(result) => result, @@ -111,5 +137,8 @@ async fn get_dataset_handler(dataset_id: &Uuid, user: &User) -> Result