mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 17:23:25 +03: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:
@@ -1,3 +1,5 @@
|
||||
const services = require('../../services/custom');
|
||||
|
||||
const Errors = {
|
||||
NOT_ENOUGH_RIGHTS: {
|
||||
notEnoughRights: 'Not enough rights',
|
||||
@@ -54,6 +56,11 @@ module.exports = {
|
||||
throw Errors.CARD_NOT_FOUND;
|
||||
}
|
||||
|
||||
const messageText = '*' + card.name + '* was deleted by ' + currentUser.username;
|
||||
services.sendSlackMessage(messageText)
|
||||
.then(() => { console.log('Slack message sent successfully.'); })
|
||||
.catch((error) => { console.error('Failed to send Slack message:', error.message); });
|
||||
|
||||
return {
|
||||
item: card,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user