Fixed tag edits not triggering tag list updates
This commit is contained in:
parent
3c54671aeb
commit
a3aea27a13
1 changed files with 16 additions and 1 deletions
|
@ -128,6 +128,7 @@ App.Presenters.TagPresenter = function(
|
||||||
promise.wait(api.put('/tags/' + tag.name, formData))
|
promise.wait(api.put('/tags/' + tag.name, formData))
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
router.navigateInplace('#/tag/' + response.json.name);
|
router.navigateInplace('#/tag/' + response.json.name);
|
||||||
|
tagList.refreshTags();
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
window.alert(response.json && response.json.error || 'An error occured.');
|
window.alert(response.json && response.json.error || 'An error occured.');
|
||||||
});
|
});
|
||||||
|
@ -140,6 +141,7 @@ App.Presenters.TagPresenter = function(
|
||||||
promise.wait(api.delete('/tags/' + tag.name))
|
promise.wait(api.delete('/tags/' + tag.name))
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
router.navigate('#/tags');
|
router.navigate('#/tags');
|
||||||
|
tagList.refreshTags();
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
window.alert(response.json && response.json.error || 'An error occured.');
|
window.alert(response.json && response.json.error || 'An error occured.');
|
||||||
});
|
});
|
||||||
|
@ -151,6 +153,7 @@ App.Presenters.TagPresenter = function(
|
||||||
promise.wait(api.put('/tags/' + tag.name + '/merge', {targetTag: targetTag}))
|
promise.wait(api.put('/tags/' + tag.name + '/merge', {targetTag: targetTag}))
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
router.navigate('#/tags');
|
router.navigate('#/tags');
|
||||||
|
tagList.refreshTags();
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
window.alert(response.json && response.json.error || 'An error occured.');
|
window.alert(response.json && response.json.error || 'An error occured.');
|
||||||
});
|
});
|
||||||
|
@ -183,4 +186,16 @@ App.Presenters.TagPresenter = function(
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
App.DI.register('tagPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'api', 'tagList', 'router', 'keyboard', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.TagPresenter);
|
App.DI.register('tagPresenter', [
|
||||||
|
'_',
|
||||||
|
'jQuery',
|
||||||
|
'util',
|
||||||
|
'promise',
|
||||||
|
'auth',
|
||||||
|
'api',
|
||||||
|
'tagList',
|
||||||
|
'router',
|
||||||
|
'keyboard',
|
||||||
|
'topNavigationPresenter',
|
||||||
|
'messagePresenter'],
|
||||||
|
App.Presenters.TagPresenter);
|
||||||
|
|
Loading…
Reference in a new issue