diff --git a/frontend/src/components/Dialog/User/DeleteUser.vue b/frontend/src/components/Dialog/User/DeleteUser.vue index 14a4cd033..1515cd2a0 100644 --- a/frontend/src/components/Dialog/User/DeleteUser.vue +++ b/frontend/src/components/Dialog/User/DeleteUser.vue @@ -11,7 +11,7 @@ const usersStore = storeUsers(); const emitter = inject>("emitter"); emitter?.on("showDeleteUserDialog", (userToDelete) => { - user.value = userToDelete; + user.value = { password: "", ...userToDelete }; show.value = true; }); diff --git a/frontend/src/components/Dialog/User/EditUser.vue b/frontend/src/components/Dialog/User/EditUser.vue index d18dc2e22..be069adb8 100644 --- a/frontend/src/components/Dialog/User/EditUser.vue +++ b/frontend/src/components/Dialog/User/EditUser.vue @@ -13,7 +13,7 @@ const usersStore = storeUsers(); const imagePreviewUrl = ref(""); const emitter = inject>("emitter"); emitter?.on("showEditUserDialog", (userToEdit) => { - user.value = { ...userToEdit, avatar: undefined }; + user.value = { ...userToEdit, password: "", avatar: undefined }; show.value = true; }); diff --git a/frontend/src/services/api/user.ts b/frontend/src/services/api/user.ts index 3b23d89f4..f93bc634d 100644 --- a/frontend/src/services/api/user.ts +++ b/frontend/src/services/api/user.ts @@ -30,17 +30,10 @@ async function fetchCurrentUser(): Promise<{ data: UserSchema | null }> { async function updateUser({ id, - username, - password, - role, - enabled, avatar, + ...attrs }: { id: number; - username: string; - password: string; - role: string; - enabled: boolean; avatar?: File[]; }): Promise<{ data: UserSchema }> { return api.put( @@ -52,7 +45,7 @@ async function updateUser({ headers: { "Content-Type": avatar ? "multipart/form-data" : "application/json", }, - params: { username, password, role, enabled }, + params: attrs, } ); } diff --git a/frontend/src/types/emitter.d.ts b/frontend/src/types/emitter.d.ts index 12cef0fdc..137b0c5f9 100644 --- a/frontend/src/types/emitter.d.ts +++ b/frontend/src/types/emitter.d.ts @@ -44,8 +44,8 @@ export type Events = { }; showCreateExclusionDialog: { exclude: string }; showCreateUserDialog: null; - showEditUserDialog: UserItem; - showDeleteUserDialog: UserItem; + showEditUserDialog: User; + showDeleteUserDialog: User; showDeleteSavesDialog: { rom: Rom; saves: SaveSchema[]; diff --git a/frontend/src/views/Settings/ControlPanel/Users/Base.vue b/frontend/src/views/Settings/ControlPanel/Users/Base.vue index 416b2d063..c8a2078d8 100644 --- a/frontend/src/views/Settings/ControlPanel/Users/Base.vue +++ b/frontend/src/views/Settings/ControlPanel/Users/Base.vue @@ -1,8 +1,8 @@