This commit is contained in:
2025-10-29 00:40:13 +01:00
parent d9b2297eca
commit 4b18429945
6 changed files with 622 additions and 47 deletions
+2 -8
View File
@@ -54,7 +54,7 @@ use uuid::Uuid;
schemas(
schemas::LoginRequest,
schemas::AccessTokenResponse,
schemas::TenantSummary,
schemas::TenantSnippet,
schemas::TenantSelectionResponse,
schemas::TenantSelectionRequest,
schemas::TenantListResponse,
@@ -605,12 +605,6 @@ pub mod schemas {
pub tenant: TenantSnippet,
}
#[derive(Serialize, Deserialize, ToSchema)]
pub struct TenantSummary {
pub tenant_id: Uuid,
pub slug: String,
}
#[derive(Serialize, Deserialize, ToSchema)]
pub struct TenantSnippet {
pub id: Uuid,
@@ -620,7 +614,7 @@ pub mod schemas {
#[derive(Serialize, Deserialize, ToSchema)]
pub struct TenantSelectionResponse {
pub access_token: String,
pub tenants: Vec<TenantSummary>,
pub tenants: Vec<TenantSnippet>,
}
#[derive(Serialize, Deserialize, ToSchema)]
+3 -9
View File
@@ -46,12 +46,6 @@ pub struct LoginResponse {
pub tenant: TenantSnippet,
}
#[derive(Serialize)]
pub struct TenantSummary {
pub tenant_id: Uuid,
pub slug: String,
}
#[derive(Serialize)]
pub struct TenantSnippet {
pub id: Uuid,
@@ -61,7 +55,7 @@ pub struct TenantSnippet {
#[derive(Serialize)]
pub struct TenantSelectionResponse {
pub access_token: String,
pub tenants: Vec<TenantSummary>,
pub tenants: Vec<TenantSnippet>,
}
#[derive(Serialize)]
@@ -132,8 +126,8 @@ pub async fn login(
let tenants = memberships
.into_iter()
.map(|(_, tenant)| TenantSummary {
tenant_id: tenant.id,
.map(|(_, tenant)| TenantSnippet {
id: tenant.id,
slug: tenant.slug,
})
.collect();