File tree 2 files changed +6
-7
lines changed
api/src/certification/session-management/domain/usecases
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ export const cancel = async function ({
27
27
throw new NotFinalizedSessionError ( ) ;
28
28
}
29
29
30
- const certificationCancelledEvent = new CertificationCancelled ( {
30
+ const event = new CertificationCancelled ( {
31
31
certificationCourseId,
32
32
juryId,
33
33
} ) ;
34
34
35
- await certificationRescoringRepository . execute ( { event : certificationCancelledEvent } ) ;
35
+ await certificationRescoringRepository . execute ( { event } ) ;
36
36
37
37
certificationCourse . cancel ( ) ;
38
38
await certificationCourseRepository . update ( { certificationCourse } ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import CertificationUncancelled from '../../../../shared/domain/events/Certifica
15
15
* @param {CertificationRescoringRepository } params.certificationRescoringRepository
16
16
* @param {SessionRepository } params.SessionRepository
17
17
*/
18
- const uncancel = async function ( {
18
+ export const uncancel = async function ( {
19
19
certificationCourseId,
20
20
juryId,
21
21
certificationCourseRepository,
@@ -31,12 +31,11 @@ const uncancel = async function ({
31
31
certificationCourse . uncancel ( ) ;
32
32
await certificationCourseRepository . update ( { certificationCourse } ) ;
33
33
34
- const certificationUncancelledEvent = new CertificationUncancelled ( {
34
+ // Note: update in first, event is less important
35
+ const event = new CertificationUncancelled ( {
35
36
certificationCourseId : certificationCourse . getId ( ) ,
36
37
juryId,
37
38
} ) ;
38
39
39
- return certificationRescoringRepository . execute ( { event : certificationUncancelledEvent } ) ;
40
+ return certificationRescoringRepository . execute ( { event } ) ;
40
41
} ;
41
-
42
- export { uncancel } ;
You can’t perform that action at this time.
0 commit comments