diff --git a/apps/web/Components/Admin/Cache/Query.tsx b/apps/web/Components/Admin/Cache/Query.tsx index 7fc0dd0..06cd4dd 100644 --- a/apps/web/Components/Admin/Cache/Query.tsx +++ b/apps/web/Components/Admin/Cache/Query.tsx @@ -7,7 +7,7 @@ import { Button, Collapse } from 'ui/elements'; import { Flex } from 'ui/grid'; type QueryProps = { - readonly handleDeleteQuery: () => void; + readonly handleDeleteQuery: () => Promise; readonly queryKey: string; }; @@ -29,12 +29,23 @@ export const Query = memo(({ handleDeleteQuery, queryKey }: QueryProps) => { }); const [activeKey, setActiveKey] = useState(undefined); + const [deletePending, setDeletePending] = useState(false); const content = ( <> {JSON.stringify(data, null, 2)} - diff --git a/apps/web/Components/Admin/Cache/QueryList.tsx b/apps/web/Components/Admin/Cache/QueryList.tsx index 97b200b..ec57065 100644 --- a/apps/web/Components/Admin/Cache/QueryList.tsx +++ b/apps/web/Components/Admin/Cache/QueryList.tsx @@ -14,16 +14,12 @@ export const QueryList = memo(({ queries }: QueryListProps) => { ); function deleteQuery(queryKey: string) { - cacheApi.deleteQuery(queryKey).then(() => setDeletedQueries([...deletedQueries, queryKey])); + return cacheApi + .deleteQuery(queryKey) + .then(() => setDeletedQueries([...deletedQueries, queryKey])); } return activeQueries.map((queryKey) => ( - { - deleteQuery(queryKey); - }} - /> + deleteQuery(queryKey)} /> )); });