Skip to content

Commit 08f72ec

Browse files
authored
Merge pull request #12 from Embucket/CP-5
Update ui endpoints
2 parents 8241aaa + 1e6611d commit 08f72ec

File tree

6 files changed

+9
-29
lines changed

6 files changed

+9
-29
lines changed

crates/nexus/src/http/ui/handlers/databases.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub async fn delete_database(
105105
("warehouseId" = Uuid, description = "Warehouse ID"),
106106
("databaseName" = String, description = "Database Name"),
107107
),
108-
operation_id = "webDatabaseDashboard",
108+
operation_id = "webGetDatabase",
109109
responses(
110110
(status = 200, description = "Successful Response", body = Database),
111111
(status = 404, description = "Database not found", body = AppError),
@@ -117,17 +117,13 @@ pub async fn get_database(
117117
Path((warehouse_id, database_name)): Path<(Uuid, String)>,
118118
) -> Result<Json<Database>, AppError> {
119119
let mut warehouse = state.get_warehouse_by_id(warehouse_id).await?;
120-
let profile = state
121-
.get_profile_by_id(warehouse.storage_profile_id.unwrap())
122-
.await?;
123120
let ident = DatabaseIdent {
124121
warehouse: WarehouseIdent::new(warehouse.id),
125122
namespace: NamespaceIdent::new(database_name),
126123
};
127124
let mut database = state.get_database(&ident).await?;
128125
let tables = state.list_tables(&ident).await?;
129126

130-
warehouse.with_details(Option::from(profile), None);
131127
database.with_details(Option::from(tables));
132128
Ok(Json(database))
133129
}

crates/nexus/src/http/ui/handlers/tables.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct ApiDoc;
3535
#[utoipa::path(
3636
get,
3737
path = "/ui/warehouses/{warehouseId}/databases/{databaseName}/tables/{tableName}",
38-
operation_id = "webTableDashboard",
38+
operation_id = "webGetTable",
3939
params(
4040
("warehouseId" = Uuid, description = "Warehouse ID"),
4141
("databaseName" = String, description = "Database Name"),
@@ -53,20 +53,14 @@ pub async fn get_table(
5353
Path((warehouse_id, database_name, table_name)): Path<(Uuid, String, String)>,
5454
) -> Result<Json<Table>, AppError> {
5555
let mut warehouse = state.get_warehouse_by_id(warehouse_id).await?;
56-
let profile = state
57-
.get_profile_by_id(warehouse.storage_profile_id.unwrap())
58-
.await?;
59-
let ident = DatabaseIdent {
60-
warehouse: WarehouseIdent::new(warehouse.id),
61-
namespace: NamespaceIdent::new(database_name),
62-
};
63-
let mut database = state.get_database(&ident).await?;
6456
let table_ident = TableIdent {
65-
database: ident,
57+
database: DatabaseIdent {
58+
warehouse: WarehouseIdent::new(warehouse.id),
59+
namespace: NamespaceIdent::new(database_name),
60+
},
6661
table: table_name,
6762
};
68-
warehouse.with_details(Option::from(profile), None);
69-
let mut table = state.get_table(&table_ident).await?;
63+
let table = state.get_table(&table_ident).await?;
7064
Ok(Json(table))
7165
}
7266

crates/nexus/src/http/ui/handlers/warehouses.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub async fn list_warehouses(
8282
#[utoipa::path(
8383
get,
8484
path = "/ui/warehouses/{warehouseId}",
85-
operation_id = "webWarehouseDashboard",
85+
operation_id = "webGetWarehouse",
8686
params(
8787
("warehouseId" = Uuid, Path, description = "Warehouse ID")
8888
),
@@ -139,7 +139,7 @@ pub async fn create_warehouse(
139139
#[utoipa::path(
140140
delete,
141141
path = "/ui/warehouses/{warehouseId}",
142-
operation_id = "webCreateWarehouse",
142+
operation_id = "webDeleteWarehouse",
143143
params(
144144
("warehouseId" = Uuid, Path, description = "Warehouse ID")
145145
),

crates/nexus/src/http/ui/models/table.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ pub struct Table {
6262
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
6363
}
6464

65-
// impl Table {
66-
// pub fn with_details(&mut self, database: Option<Database>) {
67-
// if database.is_some() {
68-
// self.database = database;
69-
// }
70-
// }
71-
// }
72-
7365
impl From<catalog::models::Table> for Table {
7466
fn from(table: catalog::models::Table) -> Self {
7567
Self {

object_store/test/873fa8c7-7819-4949-b050-403ffe6d2c91/table_data_1/metadata/196b2daf-e1e6-4c65-ab41-7c88aef05e6f.metadata.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

object_store/test/873fa8c7-7819-4949-b050-403ffe6d2c91/table_data_2/metadata/348e11f4-f1fa-45f5-b58f-fea65c1eb16a.metadata.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)