Typescript refactor.
This commit is contained in:
@@ -6,10 +6,10 @@ import useMessages from 'components/hooks/useMessages';
|
||||
export function PasswordEditForm({ onSave, onClose }) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { post, useMutation } = useApi();
|
||||
const { mutate, error, isLoading } = useMutation(data => post('/me/password', data));
|
||||
const { mutate, error, isLoading } = useMutation((data: any) => post('/me/password', data));
|
||||
const ref = useRef(null);
|
||||
|
||||
const handleSubmit = async data => {
|
||||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
onSuccess: async () => {
|
||||
onSave();
|
||||
@@ -18,7 +18,7 @@ export function PasswordEditForm({ onSave, onClose }) {
|
||||
});
|
||||
};
|
||||
|
||||
const samePassword = value => {
|
||||
const samePassword = (value: string) => {
|
||||
if (value !== ref?.current?.getValues('newPassword')) {
|
||||
return formatMessage(messages.noMatchPassword);
|
||||
}
|
||||
Reference in New Issue
Block a user