Simplify code ... don't really need to do this argument check and it's done on server side anyway

This commit is contained in:
Alexandre Aubin 2019-04-24 17:57:19 +02:00
parent 27a07d0956
commit d86ac8ec6a

View file

@ -55,27 +55,20 @@
// Upgrade apps or packages
app.get('#/upgrade/:type', function (c) {
if (c.params['type'] !== 'apps' && c.params['type'] !== 'system') {
c.flash('fail', y18n.t('unknown_argument', [c.params['type']]));
store.clear('slide');
c.redirect('#/update');
}
else {
c.confirm(
y18n.t('tools'),
// confirm_update_apps and confirm_update_packages
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
function(){
c.api('/upgrade?'+c.params["type"], function(data) {
c.view('home', data);
}, 'PUT');
},
function(){
store.clear('slide');
c.redirect('#/update');
}
);
}
c.confirm(
y18n.t('tools'),
// confirm_update_apps and confirm_update_packages
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
function(){
c.api('/upgrade?'+c.params["type"], function(data) {
c.view('home', data);
}, 'PUT');
},
function(){
store.clear('slide');
c.redirect('#/update');
}
);
});
// Display journals list