mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
# Conflicts: # pages/api/account/index.js
This commit is contained in:
commit
d784b2a8db
31 changed files with 178 additions and 149 deletions
|
|
@ -9,6 +9,7 @@ import FormLayout, {
|
|||
FormRow,
|
||||
} from 'components/layout/FormLayout';
|
||||
import useApi from 'hooks/useApi';
|
||||
import useUser from '../../hooks/useUser';
|
||||
|
||||
const initialValues = {
|
||||
current_password: '',
|
||||
|
|
@ -39,9 +40,10 @@ const validate = ({ current_password, new_password, confirm_password }) => {
|
|||
export default function ChangePasswordForm({ values, onSave, onClose }) {
|
||||
const { post } = useApi();
|
||||
const [message, setMessage] = useState();
|
||||
const { user } = useUser();
|
||||
|
||||
const handleSubmit = async values => {
|
||||
const { ok, data } = await post('/account/password', values);
|
||||
const { ok, data } = await post(`/accounts/${user.user_id}/password`, values);
|
||||
|
||||
if (ok) {
|
||||
onSave();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue