[fix] Define domain addition route before domain info.

This commit is contained in:
Jérôme Lebleu 2016-02-07 19:55:12 +01:00
parent 329cdd0329
commit cda818783a
2 changed files with 25 additions and 25 deletions

File diff suppressed because one or more lines are too long

View file

@ -30,29 +30,6 @@
}); });
}); });
// List existing domains
app.get('#/domains/:domain', function (c) {
c.api('/domains/main', function(dataMain) {
domain = {
name: c.params['domain'],
main: (c.params['domain'] == dataMain.current_main_domain) ? true : false,
url: "https://"+c.params['domain']
}
c.view('domain/domain_info', domain);
}, 'PUT');
});
// Domain DNS
app.get('#/domains/:domain/dns', function (c) {
c.api('/domains/' + c.params['domain'] + '/dns', function(data) {
domain = {
name: c.params['domain'],
dns: data
}
c.view('domain/domain_dns', domain);
});
});
// Add domain form // Add domain form
app.get('#/domains/add', function (c) { app.get('#/domains/add', function (c) {
$.get('https://dyndns.yunohost.org/domains', function() {}) $.get('https://dyndns.yunohost.org/domains', function() {})
@ -101,6 +78,29 @@
}, 'POST', params); }, 'POST', params);
}); });
// Get existing domain info
app.get('#/domains/:domain', function (c) {
c.api('/domains/main', function(dataMain) {
domain = {
name: c.params['domain'],
main: (c.params['domain'] == dataMain.current_main_domain) ? true : false,
url: "https://"+c.params['domain']
}
c.view('domain/domain_info', domain);
}, 'PUT');
});
// Domain DNS
app.get('#/domains/:domain/dns', function (c) {
c.api('/domains/' + c.params['domain'] + '/dns', function(data) {
domain = {
name: c.params['domain'],
dns: data
}
c.view('domain/domain_dns', domain);
});
});
// Remove existing domain // Remove existing domain
app.get('#/domains/:domain/delete', function (c) { app.get('#/domains/:domain/delete', function (c) {
c.confirm( c.confirm(
@ -150,4 +150,4 @@
} }
}); });
})(); })();