From 62f78a285095e1e01ed2192ff76803285c0d7a6c Mon Sep 17 00:00:00 2001 From: kalanarathnayake Date: Mon, 19 Oct 2020 03:03:44 +0530 Subject: [PATCH] Updates in create-electricity and create-water. --- src/components/create-electricity.component.js | 2 +- src/components/create-water.component.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/create-electricity.component.js b/src/components/create-electricity.component.js index 89adeb6..fcaa88a 100644 --- a/src/components/create-electricity.component.js +++ b/src/components/create-electricity.component.js @@ -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)); diff --git a/src/components/create-water.component.js b/src/components/create-water.component.js index f7e810d..eee9581 100644 --- a/src/components/create-water.component.js +++ b/src/components/create-water.component.js @@ -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));