From 6bfbb786bc3f48f7090fc0343e61293820ccda5f Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 29 Mar 2024 10:25:37 +0300 Subject: [PATCH] apps/web & apps/api: rename queryName -> queryKey --- apps/api/src/proxy/proxy.controller.ts | 4 ++-- apps/web/Components/Admin/Cache.tsx | 4 ++-- apps/web/api/cache/query.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/src/proxy/proxy.controller.ts b/apps/api/src/proxy/proxy.controller.ts index c7f18ff..a803cc8 100644 --- a/apps/api/src/proxy/proxy.controller.ts +++ b/apps/api/src/proxy/proxy.controller.ts @@ -87,11 +87,11 @@ export class ProxyController { @Delete('/delete-query') public async deleteQuery( - @Query('queryName') queryName: string, + @Query('queryKey') queryKey: string, @Res() reply: FastifyReply, ) { try { - await this.cacheManager.del(queryName); + await this.cacheManager.del(queryKey); return reply.send('ok'); } catch (error) { diff --git a/apps/web/Components/Admin/Cache.tsx b/apps/web/Components/Admin/Cache.tsx index 2d1f8f4..24f9e96 100644 --- a/apps/web/Components/Admin/Cache.tsx +++ b/apps/web/Components/Admin/Cache.tsx @@ -74,8 +74,8 @@ const QueryList = memo(({ queries }: QueryListProps) => { [deletedQueries, queries] ); - function deleteQuery(queryName: string) { - cacheApi.deleteQuery(queryName).then(() => setDeletedQueries([...deletedQueries, queryName])); + function deleteQuery(queryKey: string) { + cacheApi.deleteQuery(queryKey).then(() => setDeletedQueries([...deletedQueries, queryKey])); } return activeQueries.map((queryKey) => ( diff --git a/apps/web/api/cache/query.ts b/apps/web/api/cache/query.ts index a317383..6c8c7d6 100644 --- a/apps/web/api/cache/query.ts +++ b/apps/web/api/cache/query.ts @@ -16,11 +16,11 @@ export function getQueries({ signal }: { signal: AbortSignal }) { ); } -export function deleteQuery(queryName: string) { +export function deleteQuery(queryKey: string) { return withHandleError( axios.delete(URL_CACHE_DELETE_QUERY, { params: { - queryName, + queryKey, }, }) ).then(({ data }) => data);