Skip to content

Commit

Permalink
#2457 Fix function called in the wrong place
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalizer committed Nov 15, 2023
1 parent ff79b4b commit e38cfaf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class SubjectDataLoader {

private List<SkillsAndPoints> handleAchievements(String projectId, String userId, List<SkillsAndPoints> skillsAndPoints) {
if(projectId) {
List<String> skillIds = collectUnachievedSkillIds(skillsAndPoints)
List<String> skillIds = collectSkillIds(skillsAndPoints)
def achievedSkills = achievedLevelRepository.getAchievedDateByUserIdAndProjectIdAndSkillBatch(userId, projectId, skillIds)
if (achievedSkills) {
skillsAndPoints.each { it ->
Expand All @@ -203,7 +203,7 @@ class SubjectDataLoader {

private List<SkillsAndPoints> handleSkillExpirations(String projectId, String userId, List<SkillsAndPoints> skillsAndPoints) {
if(projectId) {
List<String> skillIds = collectSkillIds(skillsAndPoints)
List<String> skillIds = collectUnachievedSkillIds(skillsAndPoints)
def expiredSkills = expiredUserAchievementRepo.findMostRecentExpirationForAllSkills(projectId, userId, skillIds)
if (expiredSkills) {
skillsAndPoints.each { it ->
Expand Down Expand Up @@ -283,7 +283,7 @@ class SubjectDataLoader {
if(!it.achievedOn) {
if (it.skillDef.type == SkillDef.ContainerType.SkillsGroup) {
if (it.children) {
skillIds.addAll(it.children.collect { child -> child.skillDef.skillId })
skillIds.addAll(it.children.findAll{ child -> !child.achievedOn }.collect { child -> child.skillDef.skillId })
}
} else if (it.skillDef.type == SkillDef.ContainerType.Skill) {
skillIds.add(it.skillDef.skillId)
Expand Down

0 comments on commit e38cfaf

Please sign in to comment.