Fix update user.

This commit is contained in:
Brian Cao 2023-04-13 12:08:53 -07:00
parent 5fc96cf5e1
commit ef324fdf73
5 changed files with 17 additions and 6 deletions

View file

@ -16,7 +16,9 @@ import useMessages from 'hooks/useMessages';
export default function UserEditForm({ userId, data, onSave }) {
const { formatMessage, labels, messages } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error } = useMutation(({ username }) => post(`/users/${userId}`, { username }));
const { mutate, error } = useMutation(({ username, password, role }) =>
post(`/users/${userId}`, { username, password, role }),
);
const handleSubmit = async data => {
mutate(data, {