Skip to content

Commit f1f0135

Browse files
committed
♻️ chore(api) rename variable and add comment
1 parent 18b9e20 commit f1f0135

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

api/src/certification/session-management/domain/usecases/cancel.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export const cancel = async function ({
2727
throw new NotFinalizedSessionError();
2828
}
2929

30-
const certificationCancelledEvent = new CertificationCancelled({
30+
const event = new CertificationCancelled({
3131
certificationCourseId,
3232
juryId,
3333
});
3434

35-
await certificationRescoringRepository.execute({ event: certificationCancelledEvent });
35+
await certificationRescoringRepository.execute({ event });
3636

3737
certificationCourse.cancel();
3838
await certificationCourseRepository.update({ certificationCourse });

api/src/certification/session-management/domain/usecases/uncancel.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import CertificationUncancelled from '../../../../shared/domain/events/Certifica
1515
* @param {CertificationRescoringRepository} params.certificationRescoringRepository
1616
* @param {SessionRepository} params.SessionRepository
1717
*/
18-
const uncancel = async function ({
18+
export const uncancel = async function ({
1919
certificationCourseId,
2020
juryId,
2121
certificationCourseRepository,
@@ -31,12 +31,11 @@ const uncancel = async function ({
3131
certificationCourse.uncancel();
3232
await certificationCourseRepository.update({ certificationCourse });
3333

34-
const certificationUncancelledEvent = new CertificationUncancelled({
34+
// Note: update in first, event is less important
35+
const event = new CertificationUncancelled({
3536
certificationCourseId: certificationCourse.getId(),
3637
juryId,
3738
});
3839

39-
return certificationRescoringRepository.execute({ event: certificationUncancelledEvent });
40+
return certificationRescoringRepository.execute({ event });
4041
};
41-
42-
export { uncancel };

0 commit comments

Comments
 (0)