Skip to content

Commit

Permalink
nsqadmin: fix nsqadmin channel delete "this.model undefined"
Browse files Browse the repository at this point in the history
I don't fully understand "this" scope, but this change seems to
fix the delete button for both firefox and chrome.
  • Loading branch information
ploxiln committed Sep 21, 2019
1 parent 1385446 commit 56c1463
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nsqadmin/static/js/views/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ var ChannelView = BaseView.extend({
return;
}
if (action === 'delete') {
var topic = this.model.get('topic');
$.ajax(this.model.url(), {'method': 'DELETE'})
.done(function() {
window.location = AppState.basePath('/topics/' +
encodeURIComponent(this.model.get('topic')));
encodeURIComponent(topic));
})
.fail(this.handleAJAXError.bind(this));
} else {
Expand Down

0 comments on commit 56c1463

Please sign in to comment.