From 2320293a62e8eb64a170a001b1ebb828262a0653 Mon Sep 17 00:00:00 2001 From: sambokar Date: Mon, 16 Dec 2024 21:49:32 -0500 Subject: [PATCH] removing duplicate definition of async function from msvdatagrid --- .../components/datagrids/applications/msvdatagrid.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/frontend/components/datagrids/applications/msvdatagrid.tsx b/frontend/components/datagrids/applications/msvdatagrid.tsx index 4a17ec91..87f49dcc 100644 --- a/frontend/components/datagrids/applications/msvdatagrid.tsx +++ b/frontend/components/datagrids/applications/msvdatagrid.tsx @@ -1,7 +1,7 @@ 'use client'; import { useOrgCensusContext, usePlotContext, useSiteContext } from '@/app/contexts/userselectionprovider'; -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { GridRowModes, GridRowModesModel, GridRowsProp } from '@mui/x-data-grid'; import { randomId } from '@mui/x-data-grid-generator'; import { Snackbar } from '@mui/joy'; @@ -62,13 +62,6 @@ export default function MeasurementsSummaryViewDataGrid() { const [isNewRowAdded, setIsNewRowAdded] = useState(false); const [shouldAddRowAfterFetch, setShouldAddRowAfterFetch] = useState(false); - async function reloadMSV() { - setLoading(true, 'Refreshing Measurements View...'); - const response = await fetch(`/api/refreshviews/measurementssummary/${currentSite?.schemaName ?? ''}`, { method: 'POST' }); - if (!response.ok) throw new Error('Measurements View Refresh failure'); - await new Promise(resolve => setTimeout(resolve, 1000)); - } - useEffect(() => { reloadMSV() .catch(console.error)