Skip to content

Commit b999090

Browse files
committed
use path instead of input
1 parent 9615dd2 commit b999090

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/App.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,27 @@ const updatedIssueInState = mutationResult => state => {
114114

115115
class App extends Component {
116116
state = {
117-
input: 'the-road-to-learn-react/the-road-to-learn-react',
117+
path: 'the-road-to-learn-react/the-road-to-learn-react',
118118
organization: null,
119119
errors: null,
120120
};
121121

122122
componentDidMount() {
123-
this.onFetchFromGitHub(this.state.input);
123+
this.onFetchFromGitHub(this.state.path);
124124
}
125125

126126
onChange = event => {
127-
this.setState({ input: event.target.value });
127+
this.setState({ path: event.target.value });
128128
};
129129

130130
onSubmit = event => {
131-
this.onFetchFromGitHub(this.state.input);
131+
this.onFetchFromGitHub(this.state.path);
132132

133133
event.preventDefault();
134134
};
135135

136-
onFetchFromGitHub = input => {
137-
getIssuesOfRepository(input).then(result =>
136+
onFetchFromGitHub = path => {
137+
getIssuesOfRepository(path).then(result =>
138138
this.setState(() => ({
139139
organization: result.data.data.organization,
140140
errors: result.data.errors,
@@ -149,7 +149,7 @@ class App extends Component {
149149
};
150150

151151
render() {
152-
const { input, organization, errors } = this.state;
152+
const { path, organization, errors } = this.state;
153153

154154
return (
155155
<div>
@@ -162,7 +162,7 @@ class App extends Component {
162162
<input
163163
id="url"
164164
type="text"
165-
value={input}
165+
value={path}
166166
onChange={this.onChange}
167167
style={{ width: '300px' }}
168168
/>

0 commit comments

Comments
 (0)