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

Merge branch 'fixed-edit' into 'master'

Fixed edit username and password

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