diff --git a/app/queries/get_user_details.graphql b/app/queries/get_user_details.graphql index 7e72530..57b20ef 100644 --- a/app/queries/get_user_details.graphql +++ b/app/queries/get_user_details.graphql @@ -6,5 +6,8 @@ query GetUserDetails($id: String!) { firstName lastName creationDate + groups { + id + } } } diff --git a/app/src/components/user_details.rs b/app/src/components/user_details.rs index 78e7170..58fae4f 100644 --- a/app/src/components/user_details.rs +++ b/app/src/components/user_details.rs @@ -134,19 +134,24 @@ impl UserDetails { Ok(_) => { ConsoleService::log("Successfully updated user"); self.update_successful = true; - let user = self.user.as_ref().unwrap(); + let User { + id, + display_name, + first_name, + last_name, + email, + creation_date, + groups, + } = self.user.take().unwrap(); let new_user = self.update_request.take().unwrap(); self.user = Some(User { - id: user.id.clone(), - email: new_user.email.unwrap_or_else(|| user.email.clone()), - display_name: new_user - .displayName - .unwrap_or_else(|| user.display_name.clone()), - first_name: new_user - .firstName - .unwrap_or_else(|| user.first_name.clone()), - last_name: new_user.lastName.unwrap_or_else(|| user.last_name.clone()), - creation_date: user.creation_date, + id, + email: new_user.email.unwrap_or(email), + display_name: new_user.displayName.unwrap_or(display_name), + first_name: new_user.firstName.unwrap_or(first_name), + last_name: new_user.lastName.unwrap_or(last_name), + creation_date, + groups, }); } }; @@ -209,6 +214,15 @@ impl Component for UserDetails { } fn view(&self) -> Html { + type Group = get_user_details::GetUserDetailsUserGroups; + let make_group_row = |group: &Group| { + html! { +
+ | {"Group"} | +
---|---|
+ |