Skip to content
Snippets Groups Projects
Commit 2521a8e4 authored by Nicolai Hollup Brand's avatar Nicolai Hollup Brand :penguin:
Browse files

Fixed edit username and password

parent 5ea0b862
No related branches found
No related tags found
1 merge request!2Fixed edit username and password
document.getElementById("newUsername").value = sessionStorage.getItem("username");
let usernameVariable = document.getElementById("newUsername");
let passwordVariable = document.getElementById("newPassword");
usernameVariable.value = sessionStorage.getItem("username");
passwordVariable.value = sessionStorage.getItem("password");
document.getElementById("cancelButton").addEventListener("click", function(){
window.location.href = "../app.html";
});
......@@ -8,7 +13,7 @@ document.getElementById("cancelButton").addEventListener("click", function(){
*/
function editUser (event) {
event.preventDefault();
let newInformation = {};
let newInformation = {"username": usernameVariable.value, "password": passwordVariable.value};
fetch('../api/user/'+sessionStorage.getItem("userId"), {
method: "PUT",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment