#
vincentlu
2025-02-11 2d1b39fae6abed7cda7bd5722fcea23fefdb6e12
rsf-admin/src/page/settings/SecuritySettings.jsx
@@ -14,7 +14,7 @@
    InputAdornment,
    IconButton,
} from '@mui/material';
import { updateUserInfo } from '@/api/auth';
import { requestResetPassword } from '@/api/auth';
import Visibility from '@mui/icons-material/Visibility';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
@@ -39,22 +39,19 @@
    }, [userInfo, setValue])
    const onSubmit = (data) => {
        console.log(data);
        return false;
        setLoading(true);
        updateUserInfo({ id: userInfo.id, ...data }).then(res => {
        requestResetPassword(data).then(res => {
            setLoading(false);
            const { code, msg, data } = res;
            if (code === 200) {
                notify(msg, { type: 'success', messageArgs: { _: msg } });
                reset();
            } else if (code === 408) {
                setError('oldPassword', {
                    message: msg,
                });
            } else {
                notify(msg, { type: 'error', messageArgs: { _: msg } });
                setError('oldPassword', {
                    type: 'server', // make no sense
                    message: res.msg,
                });
            }
        }).catch((error) => {
            setLoading(false);