mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 02:08:47 +00:00
Changed the path of the editProfile page
This commit is contained in:
parent
a4cce0b75e
commit
5b5e785142
@ -74,7 +74,7 @@ class App extends Component {
|
||||
|
||||
<Route exact path="/home" component={home} />
|
||||
<Route exact path="/user" component={user} />
|
||||
<Route exact path="/edit" component={editProfile} />
|
||||
<Route exact path="/user/edit" component={editProfile} />
|
||||
<Route exact path="/verify" component={verify} />
|
||||
<Route exact path="/search" component={Search} />
|
||||
<Route exact path="/user/:userhandle" component={otherUser} />
|
||||
|
||||
@ -3,7 +3,6 @@ import { Link } from 'react-router-dom';
|
||||
import axios from "axios";
|
||||
import PropTypes from "prop-types";
|
||||
// TODO: Add a read-only '@' in the left side of the handle input
|
||||
// TODO: Add a cancel button, that takes the user back to their profile page
|
||||
|
||||
// Material-UI stuff
|
||||
import Box from "@material-ui/core/Box"
|
||||
@ -72,10 +71,8 @@ export class editProfile extends Component {
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
if (err.response.status === 403) {
|
||||
alert("You are not logged in");
|
||||
// TODO: Redirect them, to the profile they are trying to edit
|
||||
// If they are on /itsjimmy/edit, they will be redirected to /itsjimmy
|
||||
this.props.history.push('../');
|
||||
// This user is not logged in
|
||||
this.props.history.push('/');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -126,8 +123,7 @@ export class editProfile extends Component {
|
||||
this.setState({
|
||||
loading: false
|
||||
});
|
||||
// this.props.history.push('/');
|
||||
// TODO: Need to redirect user to their profile page
|
||||
this.props.history.push('/user');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
|
||||
@ -248,7 +248,7 @@ class user extends Component {
|
||||
// showing the logged in users profile, instead of retreiving the
|
||||
// profile based on the URL entered
|
||||
let editButtonMarkup = true ? (
|
||||
<Link to="/edit">
|
||||
<Link to="/user/edit">
|
||||
<Button className={classes.button} variant="outlined" color="primary">
|
||||
Edit Profile
|
||||
</Button>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user