summaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.js b/src/main.js
index 21a2f8f..e6cadce 100644
--- a/src/main.js
+++ b/src/main.js
@@ -53,12 +53,11 @@ async function register() {
const id = document.getElementById("id").value;
const url = server + "/user/register/"
- var body;
+ var body = {"name": username, "password": password, "id": id};
if (id == "") {
body = {"name": username, "password": password}
- } else {
- body = {"name": username, "password": password, "id": id}
}
+
const req = await xhttp_post(url, body);
if (req.status == 201) {