Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

Commit a7c3c54

Browse files
authoredApr 18, 2019
Fixed props and url param passing issue (#66)
1 parent eb34956 commit a7c3c54

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed
 

‎euphoria-frontend/src/App.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,20 @@ class App extends Component {
2020

2121
render() {
2222

23-
const {
24-
cookies,
25-
history
26-
} = this.props;
23+
const props = this.props;
2724

2825
return (
2926
<div>
3027
<Switch>
3128
<Route exact path="/" component={Splash} />
32-
<Route path="/signin" render={() => (<Signin cookies={cookies} history={history} />)} /> />
29+
<Route path="/signin" render={(props) => (<Signin {...props} />)} />
3330
<Route path="/signup" component={Signup} />
34-
<Route exact path="/postings" render={() => (<Postings cookies={cookies} history={history} />)} />
35-
<Route path="/postings/apply/:postingId" render={() => (<Apply cookies={cookies} history={history} />)} />
36-
<Route exact path="/dashboard" render={() => (<Dashboard cookies={cookies} history={history} />)} />
37-
<Route exact path="/dashboard/post" render={() => (<Post cookies={cookies} history={history} />)} />
38-
<Route path="/dashboard/post/edit/:postingId" render={() => (<Editpost cookies={cookies} history={history} />)} />
39-
<Route path="/dashboard/applications/:postingId" render={() => (<Applications cookies={cookies} history={history} />)} />
31+
<Route exact path="/postings" render={(props) => (<Postings {...props} />)} />
32+
<Route path="/postings/apply/:postingId" render={(props) => (<Apply {...props} />)} />
33+
<Route exact path="/dashboard" render={(props) => (<Dashboard {...props} />)} />
34+
<Route exact path="/dashboard/post" render={(props) => (<Post {...props} />)} />
35+
<Route path="/dashboard/post/edit/:postingId" render={(props) => (<Editpost {...props} />)} />
36+
<Route path="/dashboard/applications/:postingId" render={(props) => (<Applications {...props} />)} />
4037
<Route path="/404" component={NotFound} />
4138
<Redirect to="/404" />
4239
</Switch>

‎euphoria-frontend/src/views/Apply.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Apply extends Component {
1616

1717
componentDidMount() {
1818
let url = "http://localhost:8080/api/posting/" + this.props.match.params.postingId;
19+
console.log(this.props);
1920
this.handleGet(url);
2021
}
2122

‎euphoria-frontend/src/views/Signin.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Signin extends Component {
5252

5353
let authenticationPayload = {
5454
username: username,
55-
passwordHash: password,
55+
passwordHash: password
5656
};
5757

5858
fetch(cookieUrl, {
@@ -70,7 +70,7 @@ class Signin extends Component {
7070
cookies.set("id", cookies.id, { path: '/' });
7171
cookies.set("isUser", cookies.isUser, { path: '/' });
7272
cookies.set("authenticationHash", cookie.cookie, { path: '/' });
73-
console.log(cookies);
73+
7474
if(cookies.isUser){
7575
this.handleRedirect("/postings")
7676
}

0 commit comments

Comments
 (0)
This repository has been archived.