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