Skip to content

Commit e6bbea1

Browse files
djcarpeabshierjoel
andauthored
feat(ecommerce): Hide remove last user in operator page (#3815)
Remove option to delete the last user of an account. Co-Authored-By: Joel Abshier <jabshier@influxdata.com>
1 parent a2280fb commit e6bbea1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/operator/account/AssociatedUsersTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {OperatorContext} from 'src/operator/context/operator'
2121

2222
const AssociatedTableUsers: FC = () => {
2323
const {account, handleRemoveUserFromAccount} = useContext(AccountContext)
24+
const hasMultipleUsers = account?.users?.length > 1
2425
const {hasWritePermissions} = useContext(OperatorContext)
2526

2627
return (
@@ -41,7 +42,7 @@ const AssociatedTableUsers: FC = () => {
4142
resource={resource}
4243
infos={acctUserColumnInfo}
4344
>
44-
{hasWritePermissions && (
45+
{hasWritePermissions && hasMultipleUsers && (
4546
<RemoveFromAccount
4647
removeUser={async () => {
4748
await handleRemoveUserFromAccount(resource.id)

0 commit comments

Comments
 (0)