From 77583f883b8caaf2f660bc2d88991023f42decb6 Mon Sep 17 00:00:00 2001 From: alten-dturus Date: Thu, 2 Jan 2025 16:13:03 +0100 Subject: [PATCH] Update useGetDelegationActions.ts --- src/hooks/useGetDelegationActions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useGetDelegationActions.ts b/src/hooks/useGetDelegationActions.ts index 38753f1cf..24ee078f9 100644 --- a/src/hooks/useGetDelegationActions.ts +++ b/src/hooks/useGetDelegationActions.ts @@ -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 = [] @@ -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]) }