1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

added new custom service with slack integration helper functions; added axios package; added notifications for card create, delete, and update (move); added notifications for comment create

This commit is contained in:
Brad Bahls 2023-12-23 08:52:07 -07:00
parent fbd1b28312
commit b8ce112dc3
6 changed files with 110 additions and 0 deletions

View file

@ -1,3 +1,5 @@
const services = require('../../services/custom');
const Errors = {
NOT_ENOUGH_RIGHTS: {
notEnoughRights: 'Not enough rights',
@ -63,6 +65,12 @@ module.exports = {
request: this.req,
});
const cardUrl = services.buildCardUrl(card);
const messageText = '*' + currentUser.username + '* commented on ' + cardUrl + ':\n>' + inputs.text;
services.sendSlackMessage(messageText)
.then(() => { console.log('Slack message sent successfully.'); })
.catch((error) => { console.error('Failed to send Slack message:', error.message); });
return {
item: action,
};