mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-24 04:52:05 +00:00
fix user name
This commit is contained in:
@@ -147,6 +147,10 @@ export interface UserJWT {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface CurrentUserData {
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface ServiceProvider {
|
||||
name: string;
|
||||
ms_teams_fqdn: null | string;
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user