change name addUser script

This commit is contained in:
Valentin CZERYBA 2023-11-04 23:37:04 +01:00
parent 6fdfc80880
commit ed6d7dc4f1
4 changed files with 6 additions and 12 deletions

View File

@ -232,5 +232,5 @@
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/addUser.js"></script>
<script src="../js/addItem.js"></script>
</body></html>

View File

@ -232,5 +232,5 @@
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/addUser.js"></script>
<script src="../js/addItem.js"></script>
</body></html>

View File

@ -350,5 +350,5 @@
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/user.js"></script>
<script src="../js/item.js"></script>
</body></html>

View File

@ -1,6 +1,7 @@
checkToken();
signOut();
closeButton();
pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0].replace("add","")
document.getElementById("addUser").addEventListener("click", function(){
@ -25,25 +26,18 @@ document.getElementById("addUser").addEventListener("click", function(){
}
dataPut = {
"id": "",
"username": document.getElementById("usernameUpdateInput").value,
"email": document.getElementById("emailUpdateInput").value,
"name": document.getElementById("nameUpdateInput").value,
"firstName": document.getElementById("firstNameUpdateInput").value,
"birth": document.getElementById("birthUpdateInput").value,
"status": 1,
"password": document.getElementById("passwordUpdateInput").value,
"roles": selector["roles"],
"created_at": "",
"updated_at": "",
"deleted_at": "",
"connected_at": ""
"roles": selector["roles"]
}
instance({
method : "put",
url:"users",
url:pathURL+"s",
withCredentials: true,
data: dataPut
}).then(function(response){