Skip to content

Commit

Permalink
Update useGetDelegationActions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alten-dturus committed Jan 13, 2025
1 parent 06c2136 commit 77583f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/useGetDelegationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AuthHooks } from '@/api/auth'
export function useGetDelegationActions(delegation: Delegation | CompactDelegation | undefined) {
const { t: tCommon } = useTranslation('common', { keyPrefix: 'actions' })
const { openDialog } = useDialog()
const { jwt } = AuthHooks.useJwt()
const { jwt, isAdmin } = AuthHooks.useJwt()

const actions: Array<ActionItemButton> = []

Expand Down Expand Up @@ -62,7 +62,8 @@ export function useGetDelegationActions(delegation: Delegation | CompactDelegati

if (
delegation.state === 'WAITING_FOR_APPROVAL' &&
delegation.delegate.id === jwt?.organizationId
delegation.delegate.id === jwt?.organizationId &&
isAdmin
) {
actions.push(...[acceptAction, rejectAction])
}
Expand Down

0 comments on commit 77583f8

Please sign in to comment.