Skip to content

Commit cff5d70

Browse files
committed
finish handleSelectionChange
1 parent 38e4137 commit cff5d70

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/charts/GrafanaEventChart.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ const GrafanaEventChart: React.FC<EventChartProps> = React.memo(props => {
3838
console.log("uid: ", uid)
3939
console.log("parsedName: ", parsedName)
4040

41-
const handleSelectionChange = (event) => {
41+
const handleSelectionChange = async (event) => {
4242
setGraphType(event.target.value);
43-
fetch('http://localhost:1111/random')
43+
await fetch('http://localhost:1111/api/updateDashboard', {
44+
headers: {
45+
'Content-Type': 'application/json',
46+
},
47+
body: JSON.stringify({ graphType: event.target.value, metric: metricName })
48+
})
49+
4450
}
4551

4652
return (

0 commit comments

Comments
 (0)