Skip to content

Commit dad3f34

Browse files
committed
Update CourseRegistrationHelper.cls
1 parent d91b5cd commit dad3f34

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

force-app/main/default/classes/CourseRegistrationHelper.cls

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ public class CourseRegistrationHelper {
7777
return;
7878
}
7979

80-
Map<Id, Course__c> coursesWithCapacity = new Map<Id, Course__c>();
81-
for (Course__c course : [
82-
SELECT Id, MaxNumberOfParticipants__c, RegistrationSignupsCount__c
83-
FROM Course__c
84-
WHERE Id IN :courseIds
85-
]) {
86-
coursesWithCapacity.put(course.Id, course);
87-
}
80+
Map<Id, Course__c> coursesWithCapacity = new Map<Id, Course__c>(
81+
[
82+
SELECT Id, MaxNumberOfParticipants__c, RegistrationSignupsCount__c
83+
FROM Course__c
84+
WHERE Id IN :courseIds
85+
]
86+
);
8887

8988
for (Id courseId : courseIds) {
9089
Course__c relatedCourse = coursesWithCapacity.get(courseId);

0 commit comments

Comments
 (0)