Remove unnecessary form action/method
The forms calling the API had an unnecessary form action and method. This is because the forms have an onSubmit hook calling preventDefault. The attributes were removed to avoid confusion.
This commit is contained in:
parent
6f4dfa2227
commit
8b78a74874
@ -81,7 +81,7 @@ class MyAccountPage extends Component<any, any> { // TODO: add proper types
|
||||
|
||||
</p>
|
||||
<ErrorBox msg={this.state.error} />
|
||||
<form method="POST" action="/logout" onSubmit={this.handleLogout}>
|
||||
<form onSubmit={this.handleLogout}>
|
||||
<div className="buttons-container">
|
||||
<Link to="/edit/age.html" className="btn btn-warning">Start colouring</Link>
|
||||
<input className="btn btn-secondary" type="submit" value="Log out"/>
|
||||
@ -104,7 +104,7 @@ class MyAccountPage extends Component<any, any> { // TODO: add proper types
|
||||
<p>Are you a software developer? If so, you might be interested in these.</p>
|
||||
<h3 className="h3">API key</h3>
|
||||
<p>{this.props.user.api_key? this.props.user.api_key : '-'}</p>
|
||||
<form method="POST" action="/api/key" onSubmit={this.handleGenerateKey} className="form-group mb-3">
|
||||
<form onSubmit={this.handleGenerateKey} className="form-group mb-3">
|
||||
<input className="btn btn-warning" type="submit" value="Generate API key"/>
|
||||
</form>
|
||||
|
||||
|
@ -160,7 +160,7 @@ class SearchBox extends Component<any, any> { // TODO: add proper types
|
||||
: null;
|
||||
return (
|
||||
<div className={`search-box ${this.props.isBuilding? 'building' : ''}`} onKeyDown={this.handleKeyPress}>
|
||||
<form action="/search" method="GET" onSubmit={this.search} className="form-inline">
|
||||
<form onSubmit={this.search} className="form-inline">
|
||||
<div onClick={this.state.smallScreen ? this.expandSearch : null}>
|
||||
<SearchIcon/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user