diff --git a/src/screens/UserManagement/UserRevamp/ListUsers.res b/src/screens/UserManagement/UserRevamp/ListUsers.res index 44f507116..5569ed44e 100644 --- a/src/screens/UserManagement/UserRevamp/ListUsers.res +++ b/src/screens/UserManagement/UserRevamp/ListUsers.res @@ -19,6 +19,10 @@ let make = () => { setUserModuleEntity, ) = React.useState(_ => #Default) + let sortByEmail = (email1, email2) => { + compareLogic(email2, email1) + } + let getUserData = async (userModuleEntity: UserManagementTypes.userModuleTypes) => { setScreenStateUsers(_ => PageLoaderWrapper.Loading) try { @@ -32,6 +36,7 @@ let make = () => { ) let res = await fetchDetails(userDataURL) let userData = res->getArrayDataFromJson(itemToObjMapperForUser) + userData->Array.sort(sortByEmail) setUsersData(_ => userData->Array.map(Nullable.make)) setUsersFilterData(_ => userData->Array.map(Nullable.make)) setUserModuleEntity(_ => userModuleEntity)