File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
organizers/[organizerId]/preview
steps/AdditionalInformationStep Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 99 useAddOfferLabelMutation ,
1010 useRemoveOfferLabelMutation ,
1111} from '@/hooks/api/offers' ;
12- import { useGetRolesQuery } from '@/hooks/api/user' ;
12+ import { useGetPermissionsQuery } from '@/hooks/api/user' ;
1313import { LABEL_PATTERN } from '@/pages/steps/AdditionalInformationStep/LabelsStep' ;
1414import { Label } from '@/types/Offer' ;
1515import { Organizer } from '@/types/Organizer' ;
@@ -45,9 +45,9 @@ export const OrganizerLabelsForm = ({ organizer }: OrganizerLabelProps) => {
4545 getUniqueLabels ( organizer ) ?? [ ] ,
4646 ) ;
4747
48- const getRolesQuery = useGetRolesQuery ( ) ;
49- const roles = getRolesQuery . data ?. [ 0 ] ?. permissions ;
50- const labelsToShow = displayCultuurkuurLabels ( roles , labels ) ;
48+ const getPermissionsQuery = useGetPermissionsQuery ( ) ;
49+ const permissions = getPermissionsQuery . data ;
50+ const labelsToShow = displayCultuurkuurLabels ( permissions , labels ) ;
5151
5252 const addLabelMutation = useAddOfferLabelMutation ( ) ;
5353 const removeLabelMutation = useRemoveOfferLabelMutation ( ) ;
Original file line number Diff line number Diff line change @@ -4,14 +4,13 @@ import { useTranslation } from 'react-i18next';
44import { useQueryClient , UseQueryResult } from 'react-query' ;
55
66import { ScopeTypes } from '@/constants/OfferType' ;
7- import { PermissionTypes } from '@/constants/PermissionTypes' ;
87import { useGetLabelsByQuery } from '@/hooks/api/labels' ;
98import {
109 useAddOfferLabelMutation ,
1110 useRemoveOfferLabelMutation ,
1211} from '@/hooks/api/offers' ;
1312import { useGetEntityByIdAndScope } from '@/hooks/api/scope' ;
14- import { useGetRolesQuery } from '@/hooks/api/user' ;
13+ import { useGetPermissionsQuery , useGetRolesQuery } from '@/hooks/api/user' ;
1514import {
1615 TabContentProps ,
1716 ValidationStatus ,
@@ -62,9 +61,9 @@ function LabelsStep({
6261
6362 const queryClient = useQueryClient ( ) ;
6463
65- const getRolesQuery = useGetRolesQuery ( ) ;
66- const roles = getRolesQuery . data ?. [ 0 ] ?. permissions ;
67- const labelsToShow = displayCultuurkuurLabels ( roles , labels ) ;
64+ const getPermissionsQuery = useGetPermissionsQuery ( ) ;
65+ const permissions = getPermissionsQuery . data ;
66+ const labelsToShow = displayCultuurkuurLabels ( permissions , labels ) ;
6867
6968 useEffect ( ( ) => {
7069 onValidationChange (
You can’t perform that action at this time.
0 commit comments