From e38adb9e54447ef17da2250ed6d9b2d050ee12c4 Mon Sep 17 00:00:00 2001 From: chesedo Date: Fri, 3 May 2024 09:37:41 +0100 Subject: [PATCH] refactor: return team details when creating a new team --- gateway/src/api/latest.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gateway/src/api/latest.rs b/gateway/src/api/latest.rs index 5d4ced0f0..c3ff8fb0b 100644 --- a/gateway/src/api/latest.rs +++ b/gateway/src/api/latest.rs @@ -539,7 +539,7 @@ async fn create_team( State(RouterState { service, .. }): State, CustomErrorPath(team_name): CustomErrorPath, Claim { sub, .. }: Claim, -) -> Result { +) -> Result, ApiError> { if team_name.chars().count() > 30 { return Err(InvalidTeamName.into()); } @@ -553,7 +553,11 @@ async fn create_team( Span::current().record("shuttle.team.id", &team.id); - Ok("Team created".to_string()) + Ok(AxumJson(team::Response { + id: team.id, + display_name: team.display_name, + is_admin: true, + })) } #[instrument(skip_all, fields(shuttle.team.id = %team_id))]