Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update useGetDelegationActions.ts
Browse files Browse the repository at this point in the history
alten-dturus committed Jan 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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
@@ -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> = []

@@ -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])
}

0 comments on commit 77583f8

Please sign in to comment.