From bfe25cadc9ddc2337fcbe4ac5881e44b512b8f63 Mon Sep 17 00:00:00 2001 From: Makombe Kennedy Date: Thu, 14 Dec 2023 09:02:24 +0300 Subject: [PATCH] (fix): Fix selection of user role bugs out (#46) --- .../add-stock-user-role-scope.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx b/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx index 3e87803d..f7fd8d28 100644 --- a/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +++ b/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx @@ -187,7 +187,7 @@ const AddStockUserRoleScope: React.FC = () => { const onRoleChange = (data: { selectedItem: Role }) => { const rootLocations = locations?.map((x) => x.uuid); const filteredLocations = - formModel.locations?.filter( + formModel?.locations?.filter( (x) => !rootLocations || rootLocations.length === 0 ||