Adding edit of incoming webhook (#5272)
Adding edit of outgoing webhook Fixing spelling of error Fixing style Changing from PUT to POST for updates Fixing test failures due to merge
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
c0bb6f99f8
Коммит
19b753467d
@@ -57,6 +57,20 @@ class IntegrationStore extends EventEmitter {
|
||||
this.setIncomingWebhooks(teamId, incomingWebhooks);
|
||||
}
|
||||
|
||||
updateIncomingWebhook(incomingWebhook) {
|
||||
const teamId = incomingWebhook.team_id;
|
||||
const incomingWebhooks = this.getIncomingWebhooks(teamId);
|
||||
|
||||
for (let i = 0; i < incomingWebhooks.length; i++) {
|
||||
if (incomingWebhooks[i].id === incomingWebhook.id) {
|
||||
incomingWebhooks[i] = incomingWebhook;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.setIncomingWebhooks(teamId, incomingWebhooks);
|
||||
}
|
||||
|
||||
removeIncomingWebhook(teamId, id) {
|
||||
let incomingWebhooks = this.getIncomingWebhooks(teamId);
|
||||
|
||||
@@ -200,6 +214,10 @@ class IntegrationStore extends EventEmitter {
|
||||
this.addIncomingWebhook(action.incomingWebhook);
|
||||
this.emitChange();
|
||||
break;
|
||||
case ActionTypes.UPDATED_INCOMING_WEBHOOK:
|
||||
this.updateIncomingWebhook(action.incomingWebhook);
|
||||
this.emitChange();
|
||||
break;
|
||||
case ActionTypes.REMOVED_INCOMING_WEBHOOK:
|
||||
this.removeIncomingWebhook(action.teamId, action.id);
|
||||
this.emitChange();
|
||||
|
||||
Ссылка в новой задаче
Block a user