mirror of
https://github.com/YunoHost/dynette.git
synced 2024-09-03 20:06:17 +02:00
async/await in delete interface to avoid a whole indent level
This commit is contained in:
parent
88a30a6656
commit
f8452bdcc5
1 changed files with 23 additions and 26 deletions
|
@ -101,14 +101,12 @@ async function sha256(message) {
|
||||||
/* END SHA256 CODE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
/* END SHA256 CODE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||||
|
|
||||||
function sendDeleteRequest()
|
async function sendDeleteRequest()
|
||||||
{
|
{
|
||||||
// Compute 'true' password
|
// Compute 'true' password
|
||||||
var domain = document.getElementById("domain").value;
|
var domain = document.getElementById("domain").value;
|
||||||
var user_password = document.getElementById("password").value;
|
var user_password = document.getElementById("password").value;
|
||||||
var true_password;
|
var true_password = await sha256(domain+":"+user_password);
|
||||||
sha256(domain+":"+user_password).then(function(d) {
|
|
||||||
var true_password = d;
|
|
||||||
|
|
||||||
// Prepare request
|
// Prepare request
|
||||||
var url = "./domains/"+domain
|
var url = "./domains/"+domain
|
||||||
|
@ -139,7 +137,6 @@ function sendDeleteRequest()
|
||||||
xhttp.open("DELETE", url, true);
|
xhttp.open("DELETE", url, true);
|
||||||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
xhttp.send(params);
|
xhttp.send(params);
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue