add button css

This commit is contained in:
Romulus21
2023-09-14 23:48:06 +02:00
parent 4a733929ed
commit 076c87b016
9 changed files with 35 additions and 28 deletions

View File

@@ -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}