-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/sparcs-kaist/taxi-back into #…
…273-안-읽은-메세지-확인
- Loading branch information
Showing
17 changed files
with
5,283 additions
and
4,679 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { slackWebhookUrl: slackUrl } = require("../../loadenv"); | ||
const axios = require("axios"); | ||
const logger = require("../modules/logger"); | ||
|
||
module.exports.notifyToReportChannel = (reportUser, report) => { | ||
if (!slackUrl.report) return; | ||
|
||
const data = { | ||
text: `${reportUser}님으로부터 신고가 접수되었습니다. | ||
신고자 ID: ${report.creatorId} | ||
신고 ID: ${report.reportedId} | ||
방 ID: ${report.roomId ?? ""} | ||
사유: ${report.type} | ||
기타: ${report.etcDetail} | ||
`, | ||
}; | ||
const config = { "Content-Type": "application/json" }; | ||
|
||
axios | ||
.post(slackUrl.report, data, config) | ||
.then((res) => { | ||
logger.info("Slack webhook sent successfully"); | ||
}) | ||
.catch((err) => { | ||
logger.error("Fail to send slack webhook", err); | ||
}); | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.