add typing for userList and change userId parameter type

This commit is contained in:
2025-08-07 07:57:28 +02:00
parent cbea96f892
commit 885ad40543

View File

@@ -8,7 +8,7 @@
let userName = $state('')
let userPassword = $state('')
let userList = $state([])
let userList: { userId: string; userName: string }[] = $state([])
let addUserError = $state(false);
let addUserSuccess = $state(false);
const currentUser: string = data.user.id;
@@ -65,7 +65,7 @@
}, 5000);
}
async function deleteUser(userId: number) {
async function deleteUser(userId: string) {
const URL = `/api/users/${userId}`;
const response = await fetch(URL, {