diff --git a/frontend/src/app/core/pages/contracts/index.tsx b/frontend/src/app/core/pages/contracts/index.tsx index 8cc61542..af77a2a7 100644 --- a/frontend/src/app/core/pages/contracts/index.tsx +++ b/frontend/src/app/core/pages/contracts/index.tsx @@ -10,12 +10,16 @@ import { ContractsTemplate } from 'components/templates/contracts' export const Contracts: React.FC = () => { const { loading, getContracts, contracts } = useContracts() - const { userPermissions, getUserPermissions } = useAuth() + const { userPermissions, profile, getProfile, getUserPermissions } = useAuth() useEffect(() => { getContracts() }, [getContracts]) + useEffect(() => { + getProfile() + }, [getProfile]) + useEffect(() => { getUserPermissions() }, [getUserPermissions]) @@ -27,6 +31,7 @@ export const Contracts: React.FC = () => { loading={loading} contracts={contracts} userPermissions={userPermissions} + profile={profile} /> diff --git a/frontend/src/components/templates/contracts/index.tsx b/frontend/src/components/templates/contracts/index.tsx index 1b501441..4cc9ebf5 100644 --- a/frontend/src/components/templates/contracts/index.tsx +++ b/frontend/src/components/templates/contracts/index.tsx @@ -31,12 +31,14 @@ interface IContractsTemplate { loading: boolean contracts: Hooks.UseContractsTypes.IContract[] | undefined userPermissions: Hooks.UseAuthTypes.IUserPermission[] | undefined + profile: Hooks.UseAuthTypes.IUserDto | undefined } export const ContractsTemplate: React.FC = ({ loading, contracts, userPermissions, + profile, }) => { const navigate = useNavigate() @@ -47,17 +49,18 @@ export const ContractsTemplate: React.FC = ({ Certificate of Deposits - {havePermission(Permissions.CREATE_CERTIFICATES, userPermissions) && ( - - )} + {havePermission(Permissions.CREATE_CERTIFICATES, userPermissions) && + profile?.vault_id && ( + + )} {loading ? (