Skip to content

Commit

Permalink
Updates in create-electricity and create-water.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalanarathnayake committed Oct 18, 2020
1 parent 780db49 commit 62f78a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/create-electricity.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class CreateElectricity extends Component {
else if(this.state.amount === "0"){
this.setState({amountError : "Amount can not be 0."})
}
else if(this.state.year.length === 4 && this.state.month < "12" && this.state.amount !== "0"){
else if(this.state.year.length === 4 && this.state.month <= "12" && this.state.amount !== "0"){

axios.post('http://localhost:5000/electricityExpenses/add', electricityExpenses)
.then(res => console.log(res.data));
Expand Down
2 changes: 1 addition & 1 deletion src/components/create-water.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class CreateWater extends Component {
else if(this.state.amount === "0"){
this.setState({amountError : "Amount can not be 0."})
}
else if(this.state.year.length === 4 && this.state.month < "12" && this.state.amount !== "0"){
else if(this.state.year.length === 4 && this.state.month <= "12" && this.state.amount !== "0"){

axios.post('http://localhost:5000/waterExpenses/add', waterExpenses)
.then(res => console.log(res.data));
Expand Down

0 comments on commit 62f78a2

Please sign in to comment.