Skip to content

Commit

Permalink
fix(console): new password input disabled when user changes password (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jialeicui authored and anda-ren committed Aug 10, 2022
1 parent 0d2c783 commit 5c2a800
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion console/src/domain/user/components/PasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function PasswordForm({ currentUser, admin, onSubmit }: IPassword
const [form] = useForm()
const [css] = useStyletron()
const [useRandom, setUseRandom] = useState(false)
const [passwdValid, setPasswdValid] = useState(false)
const [passwdValid, setPasswdValid] = useState(!admin)
const [useRandomRadioVal, setUseRandomRadioVal] = useState('no')

const handelSubmit = (data: IChangePasswordSchema) => {
Expand Down
5 changes: 2 additions & 3 deletions console/src/domain/user/services/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export async function listUsers(query: IListQuerySchema): Promise<IListSchema<IU
}

export async function changePassword(data: IChangePasswordSchema) {
// TODO change uri when backend ready
const resp = await axios({
method: 'put',
url: '/api/v1/user/pwd',
data: JSON.stringify(data),
url: '/api/v1/user/current/pwd',
data: JSON.stringify({ currentUserPwd: data.originPwd, newPwd: data.userPwd }),
headers: { 'Content-Type': 'application/json' },
})

Expand Down

0 comments on commit 5c2a800

Please sign in to comment.