Skip to content

Commit

Permalink
chore: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
meltyshev committed Apr 7, 2024
1 parent bcacfa8 commit b46fb43
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 95 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
}
},
"dependencies": {
"axios": "^1.6.2",
"concurrently": "^8.2.2",
"husky": "^8.0.3",
"lint-staged": "^15.1.0"
Expand Down
7 changes: 0 additions & 7 deletions server/api/controllers/cards/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const moment = require('moment');
const services = require('../../services/slack');

const Errors = {
NOT_ENOUGH_RIGHTS: {
Expand Down Expand Up @@ -110,12 +109,6 @@ module.exports = {
})
.intercept('positionMustBeInValues', () => Errors.POSITION_MUST_BE_PRESENT);

const cardUrl = services.buildCardUrl(card);
const messageText = cardUrl + ' was created by ' + currentUser.name + ' 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,
};
Expand Down
7 changes: 0 additions & 7 deletions server/api/controllers/cards/delete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const services = require('../../services/slack');

const Errors = {
NOT_ENOUGH_RIGHTS: {
notEnoughRights: 'Not enough rights',
Expand Down Expand Up @@ -57,11 +55,6 @@ module.exports = {
throw Errors.CARD_NOT_FOUND;
}

const messageText = '*' + card.name + '* was deleted by ' + currentUser.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,
};
Expand Down
14 changes: 0 additions & 14 deletions server/api/controllers/cards/update.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const moment = require('moment');
const services = require('../../services/slack');

const Errors = {
NOT_ENOUGH_RIGHTS: {
Expand Down Expand Up @@ -176,8 +175,6 @@ module.exports = {
'isSubscribed',
]);

const cardPositionBefore = card.position;

card = await sails.helpers.cards.updateOne
.with({
board,
Expand All @@ -198,17 +195,6 @@ module.exports = {
throw Errors.CARD_NOT_FOUND;
}

const cardPositionAfter = card.position;
const cardMoved = cardPositionBefore !== cardPositionAfter;

if (cardMoved) {
const cardUrl = services.buildCardUrl(card);
const messageText = cardUrl + ' was moved by ' + currentUser.name + ' to *' + nextList.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,
};
Expand Down
8 changes: 0 additions & 8 deletions server/api/controllers/comment-actions/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const services = require('../../services/slack');

const Errors = {
NOT_ENOUGH_RIGHTS: {
notEnoughRights: 'Not enough rights',
Expand Down Expand Up @@ -66,12 +64,6 @@ module.exports = {
request: this.req,
});

const cardUrl = services.buildCardUrl(card);
const messageText = '*' + currentUser.name + '* 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,
};
Expand Down
58 changes: 0 additions & 58 deletions server/api/services/slack.js

This file was deleted.

0 comments on commit b46fb43

Please sign in to comment.