Open
Conversation
Contributor
|
Run |
SimonB407
suggested changes
Sep 27, 2019
| @@ -0,0 +1,4 @@ | |||
| export default { | |||
| apiToken: process.env.SLACK_API_TOKEN, | |||
| channel: process.env.SLACK_NOTIFICATIONS_CHANNEL, | |||
Contributor
There was a problem hiding this comment.
Suggested change
| channel: process.env.SLACK_NOTIFICATIONS_CHANNEL, | |
| channel: process.env.SLACK_NOTIFICATIONS_CHANNEL || '', |
| ) { | ||
| } | ||
|
|
||
| @Post('/slack/to-users') |
Contributor
There was a problem hiding this comment.
Post by default returns 201 Created. I am not sure that this should do this.
Maybe 204 is better?
| } | ||
|
|
||
| @Post('/slack/to-channel') | ||
| public async sendNotificationToChannel(@Query('date') date: string) { |
Contributor
There was a problem hiding this comment.
Post by default returns 201 Created. I am not sure that this should do this.
Maybe 204 is better?
| providers: [NotificationsService, SlackService], | ||
| }) | ||
| export class NotificationsModule { | ||
| } |
Contributor
There was a problem hiding this comment.
Can be moved to the same line, but it's nothing special :)
| @Post('/slack/to-channel') | ||
| public async sendNotificationToChannel(@Query('date') date: string) { | ||
| const lastWorkingDate = new Date(date); // todo get last working date | ||
| const users: UserWorklogResult[] = await this.aggregatorService.aggregate(lastWorkingDate); |
Contributor
There was a problem hiding this comment.
What do you think, should we move worklogs aggregation to NotificationService? I think it's service work.
| .map(result => [`:pisiorek: ${result.firstName} ${result.lastName}`]) | ||
| .join('\n')}`; | ||
|
|
||
| return this.slackService.sendToChannel(message, 'worklog-monitor-int'); |
Co-Authored-By: SimonB407 <51948193+SimonB407@users.noreply.github.com>
# Conflicts: # .env.dist # package.json # src/app.module.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.