Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Pages/UserManager/EditUserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
getUserById,
editUser,
} from '../../APIFunctions/User';
import { useUser } from '../../Components/context/UserContext';

import MajorDropdown from '../MembershipApplication/MajorDropdown';
import RoleDropdown from './RoleDropdown';
Expand All @@ -12,6 +13,7 @@ import { sendVerificationEmail } from '../../APIFunctions/Mailer';


export default function EditUserInfo(props) {
const { user } = useUser();
const [firstName, setFirstName] = useState('');
const [lastName, setLastName] = useState('');
const [password, setPassword] = useState(null);
Expand Down Expand Up @@ -44,7 +46,7 @@ export default function EditUserInfo(props) {

useEffect(() => {
async function getUser() {
const result = await getUserById(props.match.params.id, props.user.token);
const result = await getUserById(props.match.params.id, user.token);
if (result.error) {
setUserNotFound(true);
} else {
Expand Down Expand Up @@ -102,7 +104,7 @@ export default function EditUserInfo(props) {
accessLevel,
emailVerified,
emailOptIn,
}, props.user.token);
}, user.token);
if (result.error) {
alert(
'saving user failed. please contact dev team if retrying fails.'
Expand Down Expand Up @@ -293,7 +295,7 @@ export default function EditUserInfo(props) {
className="btn btn-success w-auto"
checked={emailOptIn}
onClick={async () => {
const result = await sendVerificationEmail(email, props.user.token);
const result = await sendVerificationEmail(email, user.token);
if (result.error) {
return alert(
'unable to send verification email.' +
Expand Down