mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 09:13:23 +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,4 +1,5 @@
|
||||
const moment = require('moment');
|
||||
const services = require('../../services/custom');
|
||||
|
||||
const Errors = {
|
||||
NOT_ENOUGH_RIGHTS: {
|
||||
@@ -108,6 +109,12 @@ module.exports = {
|
||||
})
|
||||
.intercept('positionMustBeInValues', () => Errors.POSITION_MUST_BE_PRESENT);
|
||||
|
||||
const cardUrl = services.buildCardUrl(card);
|
||||
const messageText = cardUrl + ' was created by ' + currentUser.username + ' in *' + list.name + '*';
|
||||
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