refactor user editing functionality to remove password handling

This commit is contained in:
2025-09-03 14:25:12 +02:00
parent 5a058de2f0
commit 13a654561e
4 changed files with 9 additions and 11 deletions

View File

@@ -237,7 +237,6 @@ const UserTable: React.FC = () => {
user.id,
user.username,
user.role,
user.password
).then((response) => {
if (response.success) {
setError(

View File

@@ -24,19 +24,18 @@ export const handleDelete = async (userId: number) => {
export const handleEdit = async (
userId: number,
username: string,
role: string,
password: string
role: string
) => {
try {
const response = await fetch(
`http://localhost:8002/api/editUser/${userId}`,
{
method: "PUT",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${Cookies.get("token")}`,
},
body: JSON.stringify({ username, role, password }),
body: JSON.stringify({ username, role }),
}
);
if (!response.ok) {