File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,22 @@ export class RotationsService {
69
69
70
70
if ( tomorrowLibrarian . length === 0 ) {
71
71
return ;
72
- }
72
+ } else if ( tomorrowLibrarian . length === 1 ) {
73
+ const tomorrowLibrarianOne = tomorrowLibrarian [ 0 ] . user ;
73
74
74
- const tomorrowLibrarianOne = tomorrowLibrarian [ 0 ] . user ;
75
- const tomorrowLibrarianTwo = tomorrowLibrarian [ 1 ] . user ;
75
+ const message = `[알림] 내일은 ${ tomorrowLibrarianOne . nickname } 님이 사서입니다!` ;
76
76
77
- const message = `[알림] 내일은 ${ tomorrowLibrarianOne . nickname } 님과 ${ tomorrowLibrarianTwo . nickname } 님이 사서입니다!` ;
77
+ await this . slackService . sendDirectMessage ( tomorrowLibrarianOne . slackMemberId , message ) ;
78
+ return ;
79
+ } else {
80
+ const tomorrowLibrarianOne = tomorrowLibrarian [ 0 ] . user ;
81
+ const tomorrowLibrarianTwo = tomorrowLibrarian [ 1 ] . user ;
78
82
79
- await this . slackService . sendDirectMessage ( tomorrowLibrarianOne . slackMemberId , message ) ;
80
- await this . slackService . sendDirectMessage ( tomorrowLibrarianTwo . slackMemberId , message ) ;
83
+ const message = `[알림] 내일은 ${ tomorrowLibrarianOne . nickname } 님과 ${ tomorrowLibrarianTwo . nickname } 님이 사서입니다!` ;
84
+
85
+ await this . slackService . sendDirectMessage ( tomorrowLibrarianOne . slackMemberId , message ) ;
86
+ await this . slackService . sendDirectMessage ( tomorrowLibrarianTwo . slackMemberId , message ) ;
87
+ }
81
88
}
82
89
83
90
/*
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export class SlackService {
9
9
10
10
async sendDirectMessage ( slackId : string , message : string ) : Promise < void > {
11
11
if ( slackId . length === 0 || slackId === undefined || slackId === null ) {
12
- this . logger . warn ( 'Slack ID is not defined' ) ;
12
+ this . logger . warn ( 'Slack ID is not defined or empty. ' ) ;
13
13
return ;
14
14
}
15
15
You can’t perform that action at this time.
0 commit comments