Skip to content
Snippets Groups Projects
Commit bc65a2c1 authored by Xiemuqing Xiao's avatar Xiemuqing Xiao
Browse files

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/main/java/uk/ac/cf/spring/demo/sports/Userdetail/UserController.java
#	src/main/java/uk/ac/cf/spring/demo/sports/Userdetail/UserService.java
#	src/main/java/uk/ac/cf/spring/demo/sports/Userdetail/UserServiceImpl.java
parents afd9a7c5 f39970e2
Branches 71_Xiao
No related tags found
5 merge requests!51Resolves 64,!49Resolve issue 70,!48Resolve issue 70,!47Revert "Merge branch '26-as-a-user-i-want-to-see-the-rankings-of-each-member' into 'main'",!37As an admin, I want to through a table to update new user so that admin can update user information and classify role
...@@ -33,7 +33,8 @@ public class SecurityConfig { ...@@ -33,7 +33,8 @@ public class SecurityConfig {
"/html/login.html", // login "/html/login.html", // login
"/html/table-tennisrules.html", "/html/table-tennisrules.html",
"/rankings", //ranking data path "/rankings", //ranking data path
"/rankings/**" "/rankings/**",
"/html/table-tennisrules.html"
}; };
public static final String[] ADMIN_WHITELIST = { public static final String[] ADMIN_WHITELIST = {
......
...@@ -52,6 +52,6 @@ ...@@ -52,6 +52,6 @@
loadFooter('footer-container'); loadFooter('footer-container');
</script> </script>
<script src="/js/rankingTable.js"></script> <script src="/js/rankingTable.js"></script>
<script src="/js/matchSchedule.js"></script> <!--<script src="/js/matchSchedule.js"></script>-->
</body> </body>
</html> </html>
\ No newline at end of file
// userTable.js // userTable.js
// 动态加载用户数据 // 动态加载用户数据
async function loadUsers() { async function loadUsers(id) {
try { try {
const response = await fetch('/api/users'); // 确保后端提供了此 API const response = await fetch('/api/users/${id}'); // 确保后端提供了此 API
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`); throw new Error(`HTTP error! Status: ${response.status}`);
} }
...@@ -28,10 +28,9 @@ async function loadUsers() { ...@@ -28,10 +28,9 @@ async function loadUsers() {
`; `;
tbody.appendChild(row); tbody.appendChild(row);
}); });
} catch (error) { }
catch (error) {
console.error('Error loading users:', error); console.error('Error loading users:', error);
const tbody = document.querySelector('tbody');
tbody.innerHTML = `<tr><td colspan="4">Failed to load user data.</td></tr>`;
} }
} }
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<link rel="stylesheet" href="../css/UserCenter.css">
</head> </head>
<body> <body>
<table> <table>
<thead> <thead>
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment