From d6cbf18dce2c347ed698d4a4e6a9fc8611510327 Mon Sep 17 00:00:00 2001 From: obarykina Date: Thu, 20 Jun 2024 17:32:15 +0300 Subject: [PATCH] added clear all cache button --- apps/web/Components/Admin/Cache/index.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/web/Components/Admin/Cache/index.tsx b/apps/web/Components/Admin/Cache/index.tsx index e9ff863..1484e7c 100644 --- a/apps/web/Components/Admin/Cache/index.tsx +++ b/apps/web/Components/Admin/Cache/index.tsx @@ -1,9 +1,10 @@ import Background from '../../Layout/Background'; import { useFilteredQueries } from './lib/hooks'; import { QueryList } from './QueryList'; +import { reset } from '@/api/cache/query'; import { min } from '@/styles/mq'; import styled from 'styled-components'; -import { Collapse, Divider, Input } from 'ui/elements'; +import { Button, Collapse, Divider, Input } from 'ui/elements'; const Wrapper = styled(Background)` padding: 4px 6px; @@ -27,7 +28,12 @@ const Flex = styled.div` `; export function Cache() { - const { filteredQueries, setFilterString } = useFilteredQueries(); + const { filteredQueries, refetch, setFilterString } = useFilteredQueries(); + + async function handleDeleteQuery() { + await reset(); + refetch(); + } if (!filteredQueries) { return
Загрузка...
; @@ -51,6 +57,11 @@ export function Cache() { label: queryGroupName, }))} /> + + + ); }