add button css
This commit is contained in:
@@ -16,24 +16,20 @@ const Rainfall = () => {
|
||||
start_date: (new Date((new Date()).setMonth((new Date).getMonth() - 1))).toSQLDate(),
|
||||
end_date: (new Date()).toSQLDate(),
|
||||
})
|
||||
const {axiosGet} = useAxiosTools()
|
||||
const {errorCatch, errorLabel, axiosGet} = useAxiosTools()
|
||||
const {targetRef, dimensions} = useDimension()
|
||||
|
||||
useEffect(() => {
|
||||
fetchGraphData()
|
||||
}, [loadedAt])
|
||||
|
||||
useEffect(() => {
|
||||
fetchGraphData()
|
||||
}, [graphDetails])
|
||||
}, [loadedAt, graphDetails])
|
||||
|
||||
const fetchGraphData = async () => {
|
||||
try {
|
||||
const params = `start=${graphDetails.start_date}&end=${graphDetails.end_date}`
|
||||
const res = await axiosGet(`/api/rainfalls/graph?${params}`)
|
||||
setGraphData(res.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} catch (error) {
|
||||
errorCatch(error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +39,8 @@ const Rainfall = () => {
|
||||
<AddRainfall reload={reload} />
|
||||
</div>
|
||||
|
||||
<form className="flex mb-2 mx-5 flex gap-2">
|
||||
{errorLabel()}
|
||||
<form className="flex mb-2 mx-5 gap-2">
|
||||
<Field name="start_date"
|
||||
type="date"
|
||||
value={graphDetails.start_date}
|
||||
|
||||
Reference in New Issue
Block a user