Edit APIs

This commit is contained in:
2024-02-03 17:55:54 +01:00
parent 8b7e465796
commit 1e037cd6a2
3 changed files with 59 additions and 34 deletions

View File

@@ -1,11 +1,11 @@
<script>
function changePassword() {
const userId = document.getElementById("changeUserId").value;
const oldPassword = document.getElementById("changeoldPassword").value;
const newPassword = document.getElementById("changeNewPassword").value;
const data = new URLSearchParams();
data.append("action", "change_password");
data.append("user_id", userId);
data.append("old_password", oldPassword);
data.append("new_password", newPassword);
doChangePassword(data, "Password change Successful!", "Password change failed.");
@@ -87,56 +87,53 @@
<div class="form-container" id="changePasswordForm">
<h1>Change Password</h1>
<form>
<label for="changeUserId">User ID:</label>
<input type="text" id="changeUserId" name="changeUserId" required>
<label for="changeOldPassword">Old Password:</label>
<input type="password" id="changeOldPassword" name="changeOldPassword" required>
<input type="password" id="changeOldPassword" name="changeOldPassword" required><br>
<label for="changeNewPassword">New Password:</label>
<input type="password" id="changeNewPassword" name="changeNewPassword" required>
<input type="password" id="changeNewPassword" name="changeNewPassword" required><br>
<button type="button" onclick="changePassword()">Change Password</button>
</form>
</form><br>
</div>
<div class="form-container" id="updateUserProfileForm">
<h1>Update User Profile</h1>
<form>
<label for="updateUserIdProfile">User ID:</label>
<input type="text" id="updateUserIdProfile" name="updateUserIdProfile" required>
<input type="text" id="updateUserIdProfile" name="updateUserIdProfile" required><br>
<label for="updateFirstName">First Name:</label>
<input type="text" id="updateFirstName" name="updateFirstName" required>
<input type="text" id="updateFirstName" name="updateFirstName" required><br>
<label for="updateLastName">Last Name:</label>
<input type="text" id="updateLastName" name="updateLastName" required>
<input type="text" id="updateLastName" name="updateLastName" required><br>
<label for="updateNickname">Nickname:</label>
<input type="text" id="updateNickname" name="updateNickname" required>
<input type="text" id="updateNickname" name="updateNickname" required><br>
<label for="updateMinecraftNick">Minecraft Nick:</label>
<input type="text" id="updateMinecraftNick" name="updateMinecraftNick" required>
<input type="text" id="updateMinecraftNick" name="updateMinecraftNick" required><br>
<button type="button" onclick="updateUserProfile()">Update Profile</button>
</form>
</form><br>
</div>
<div class="form-container" id="getUserInfoForm">
<h1>Get User Info</h1>
<form>
<button type="button" onclick="getUserInfo()">Get User Info</button>
</form>
</form><br>
</div>
<div class="form-container" id="updateUserEmailForm">
<h1>Update User Email</h1>
<form>
<label for="updateNewEmail">New Email:</label>
<input type="email" id="updateNewEmail" name="updateNewEmail" required>
<input type="email" id="updateNewEmail" name="updateNewEmail" required><br>
<button type="button" onclick="updateEmail()">Update Email</button>
</form>
</form><br>
</div>
<button type="button" onclick="logout()">Logout</button>
<button type="button" onclick="logout()">Logout</button><br>