fix: fix null password
This commit is contained in:
@@ -168,8 +168,8 @@ export const UserEditPage = observer(() => {
|
||||
<TextField
|
||||
fullWidth
|
||||
label="Пароль"
|
||||
placeholder="Оставить пустым, чтобы не менять"
|
||||
value={editUserData.password || ""}
|
||||
required
|
||||
onChange={(e) =>
|
||||
setEditUserData(
|
||||
editUserData.name || "",
|
||||
|
||||
@@ -121,6 +121,7 @@ class UserStore {
|
||||
editUser = async (id: number) => {
|
||||
const payload = { ...this.editUserData };
|
||||
if (!payload.icon) delete payload.icon;
|
||||
if (!payload.password?.trim()) delete payload.password;
|
||||
const response = await authInstance.patch(`/user/${id}`, payload);
|
||||
|
||||
runInAction(() => {
|
||||
|
||||
Reference in New Issue
Block a user