Skip to content

Commit

Permalink
Allow access for dispatchers.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura committed Mar 5, 2024
1 parent 389ed1d commit 0825161
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/navigation/components/DrawerContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class DrawerContent extends Component {
label={this.props.t('TASKS')}
onPress={() => this.props.navigation.navigate('CourierNav')}/>
)}
{(isAuthenticated && user.hasRole('ROLE_ADMIN')) && (
{(isAuthenticated && user.hasRole('ROLE_DISPATCHER')) && (
<DrawerItem
label={this.props.t('DISPATCH')}
onPress={() => this.props.navigation.navigate('DispatchNav')}/>
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/navigators/DrawerNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const DrawerNav = ({ initialRouteName, user, isAuthenticated, showRestaurantsDra
name="StoreNav"
component={ StoreNavigator } />
)}
{ (isAuthenticated && user.hasRole('ROLE_ADMIN')) && (
{ (isAuthenticated && user.hasRole('ROLE_DISPATCHER')) && (
<Drawer.Screen
name="DispatchNav"
component={ DispatchNavigator } />
Expand Down
2 changes: 1 addition & 1 deletion src/redux/App/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const selectInitialRouteName = createSelector(
return 'CourierNav'
}

if (user.hasRole('ROLE_ADMIN')) {
if (user.hasRole('ROLE_DISPATCHER')) {
return 'DispatchNav'
}

Expand Down
Binary file added src/utils/IMG_2235.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0825161

Please sign in to comment.