Update UserService.java

This commit is contained in:
Ludy 2025-04-05 15:51:11 +02:00 committed by GitHub
parent 4d6f951604
commit a8bc788628
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -475,6 +475,12 @@ public class UserService implements UserServiceInterface {
@Override
public long getTotalUsersCount() {
return userRepository.count();
// Count all users in the database
long userCount = userRepository.count();
// Exclude the internal API user from the count
if (findByUsernameIgnoreCase(Role.INTERNAL_API_USER.getRoleId()).isPresent()) {
userCount -= 1;
}
return userCount;
}
}