fix user name

This commit is contained in:
eglehelms
2022-12-09 14:37:27 +01:00
parent 2f868d955d
commit fd749e1a2e
3 changed files with 15 additions and 3 deletions
+4
View File
@@ -147,6 +147,10 @@ export interface UserJWT {
name: string;
}
export interface CurrentUserData {
user: User;
}
export interface ServiceProvider {
name: string;
ms_teams_fqdn: null | string;
+3 -3
View File
@@ -12,11 +12,11 @@ import { MSG_LOGGED_OUT } from "src/constants";
import "./styles.scss";
import { ROUTE_INTERNAL_USERS } from "src/router/routes";
import { useApiData } from "src/api";
import { User } from "src/api/types";
import { CurrentUserData } from "src/api/types";
export const Layout = () => {
const user = useSelectState("user");
const [userData] = useApiData<User>("Users/me");
const [userData] = useApiData<CurrentUserData>("Users/me");
const [active, setActive] = useState(false);
const { signout } = useAuth();
const mobile = useMobileMedia();
@@ -56,7 +56,7 @@ export const Layout = () => {
to={`${ROUTE_INTERNAL_USERS}/${user?.user_sid}/edit`}
title="Edit user"
>
<strong>{userData?.name}</strong>
<strong>{userData?.user.name}</strong>
</Link>
</div>
<div>
@@ -11,6 +11,8 @@ import { hasLength, hasValue, useFilteredResults } from "src/utils";
import type { Account } from "src/api/types";
import { USER_ACCOUNT } from "src/api/constants";
// import { useScopedRedirect } from "src/utils/use-scoped-redirect";
// import { Scope } from "src/store/types";
export const Accounts = () => {
const user = useSelectState("user");
@@ -20,6 +22,12 @@ export const Accounts = () => {
const filteredAccounts = useFilteredResults<Account>(filter, accounts);
// useScopedRedirect(
// user,
// Scope.service_provider,
// `${ROUTE_INTERNAL_ACCOUNTS}/${user?.account_sid}/edit`
// );
const handleDelete = () => {
if (account) {
if (