mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Simplify code ... don't really need to do this argument check and it's done on server side anyway
This commit is contained in:
parent
27a07d0956
commit
d86ac8ec6a
1 changed files with 14 additions and 21 deletions
|
@ -55,27 +55,20 @@
|
||||||
|
|
||||||
// Upgrade apps or packages
|
// Upgrade apps or packages
|
||||||
app.get('#/upgrade/:type', function (c) {
|
app.get('#/upgrade/:type', function (c) {
|
||||||
if (c.params['type'] !== 'apps' && c.params['type'] !== 'system') {
|
c.confirm(
|
||||||
c.flash('fail', y18n.t('unknown_argument', [c.params['type']]));
|
y18n.t('tools'),
|
||||||
store.clear('slide');
|
// confirm_update_apps and confirm_update_packages
|
||||||
c.redirect('#/update');
|
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
|
||||||
}
|
function(){
|
||||||
else {
|
c.api('/upgrade?'+c.params["type"], function(data) {
|
||||||
c.confirm(
|
c.view('home', data);
|
||||||
y18n.t('tools'),
|
}, 'PUT');
|
||||||
// confirm_update_apps and confirm_update_packages
|
},
|
||||||
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
|
function(){
|
||||||
function(){
|
store.clear('slide');
|
||||||
c.api('/upgrade?'+c.params["type"], function(data) {
|
c.redirect('#/update');
|
||||||
c.view('home', data);
|
}
|
||||||
}, 'PUT');
|
);
|
||||||
},
|
|
||||||
function(){
|
|
||||||
store.clear('slide');
|
|
||||||
c.redirect('#/update');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Display journals list
|
// Display journals list
|
||||||
|
|
Loading…
Add table
Reference in a new issue