@@ -82,8 +82,8 @@ export const useProbeFilters = ({ active = () => true }: ProbeFiltersOptions = {
8282 ...! isDefault ( 'by' ) && { by : filter . value . by } ,
8383 ...filter . value . desc && { desc : 'true' } ,
8484 ...! isDefault ( 'status' ) && { status : filter . value . status } ,
85- ...auth . isAdmin && ! isDefault ( 'adoption' ) && { adoption : filter . value . adoption } ,
86- ...auth . isAdmin && ! isDefault ( 'probeType' ) && { type : filter . value . probeType } ,
85+ ...auth . adminMode && ! isDefault ( 'adoption' ) && { adoption : filter . value . adoption } ,
86+ ...auth . adminMode && ! isDefault ( 'probeType' ) && { type : filter . value . probeType } ,
8787 } ) ;
8888
8989 const onParamChange = ( ) => {
@@ -123,10 +123,10 @@ export const useProbeFilters = ({ active = () => true }: ProbeFiltersOptions = {
123123 ...filterValue . search && { searchIndex : { _icontains : filterValue . search } } ,
124124 ...! ignoredFields . includes ( 'status' ) && ! isDefault ( 'status' , filter ) && { status : { _in : STATUS_MAP [ filterValue . status ] . options } } ,
125125 ...! ignoredFields . includes ( 'status' ) && filterValue . status === 'online-outdated' && { isOutdated : { _eq : true } } ,
126- ...! ignoredFields . includes ( 'adoption' ) && auth . isAdmin && ! isDefault ( 'adoption' , filter ) && {
126+ ...! ignoredFields . includes ( 'adoption' ) && auth . adminMode && ! isDefault ( 'adoption' , filter ) && {
127127 userId : filterValue . adoption === 'adopted' ? { _neq : null } : { _eq : null } ,
128128 } ,
129- ...! ignoredFields . includes ( 'probeType' ) && auth . isAdmin && ! isDefault ( 'probeType' , filter ) && {
129+ ...! ignoredFields . includes ( 'probeType' ) && auth . adminMode && ! isDefault ( 'probeType' , filter ) && {
130130 hardwareDevice : filterValue . probeType === 'hardware' ? { _neq : null } : { _eq : null } ,
131131 } ,
132132 } ;
@@ -172,13 +172,13 @@ export const useProbeFilters = ({ active = () => true }: ProbeFiltersOptions = {
172172 filter . value . status = DEFAULT_FILTER . status ;
173173 }
174174
175- if ( typeof adoption === 'string' && ADOPTION_OPTIONS . includes ( adoption ) && auth . isAdmin ) {
175+ if ( typeof adoption === 'string' && ADOPTION_OPTIONS . includes ( adoption ) && auth . adminMode ) {
176176 filter . value . adoption = adoption as AdoptionOption ;
177177 } else {
178178 filter . value . adoption = DEFAULT_FILTER . adoption ;
179179 }
180180
181- if ( typeof probeType === 'string' && PROBE_TYPE_OPTIONS . includes ( probeType ) && auth . isAdmin ) {
181+ if ( typeof probeType === 'string' && PROBE_TYPE_OPTIONS . includes ( probeType ) && auth . adminMode ) {
182182 filter . value . probeType = probeType as ProbeTypeOption ;
183183 } else {
184184 filter . value . probeType = DEFAULT_FILTER . probeType ;
0 commit comments