apps: rename flush-all to reset-queries

This commit is contained in:
vchikalkin 2024-03-04 15:44:43 +03:00
parent abb3874248
commit 0fdef002ed
7 changed files with 13 additions and 13 deletions

View File

@ -92,8 +92,8 @@ export class ProxyController {
}
}
@Delete('/flush-all')
public async flushAll(@Res() reply: FastifyReply) {
@Delete('/reset')
public async reset(@Res() reply: FastifyReply) {
try {
await this.cacheManager.reset();

View File

@ -4,7 +4,7 @@ import { withHandleError } from '@/utils/axios';
import type { QueryFunctionContext } from '@tanstack/react-query';
import axios from 'axios';
const { URL_CACHE_GET_QUERIES, URL_CACHE_DELETE_QUERY, URL_CACHE_FLUSH_ALL } = getUrls();
const { URL_CACHE_GET_QUERIES, URL_CACHE_DELETE_QUERY, URL_CACHE_RESET_QUERIES } = getUrls();
export function getQueries({ signal }: QueryFunctionContext) {
return withHandleError(axios.get<ResponseQueries>(URL_CACHE_GET_QUERIES, { signal })).then(
@ -22,6 +22,6 @@ export function deleteQuery(queryName: string) {
).then(({ data }) => data);
}
export function flushAll() {
return withHandleError(axios.delete(URL_CACHE_FLUSH_ALL)).then(({ data }) => data);
export function reset() {
return withHandleError(axios.delete(URL_CACHE_RESET_QUERIES)).then(({ data }) => data);
}

View File

@ -8,7 +8,7 @@ const envSchema = z.object({
SENTRY_ENVIRONMENT: z.string(),
URL_1C_TRANSTAX_DIRECT: z.string(),
URL_CACHE_DELETE_QUERY_DIRECT: z.string(),
URL_CACHE_FLUSH_ALL_DIRECT: z.string(),
URL_CACHE_RESET_QUERIES_DIRECT: z.string(),
URL_CACHE_GET_QUERIES_DIRECT: z.string(),
URL_CORE_CALCULATE_DIRECT: z.string(),
URL_CORE_FINGAP_DIRECT: z.string(),

View File

@ -14,7 +14,7 @@ const serverRuntimeConfigSchema = envSchema.pick({
SENTRY_ENVIRONMENT: true,
URL_1C_TRANSTAX_DIRECT: true,
URL_CACHE_DELETE_QUERY_DIRECT: true,
URL_CACHE_FLUSH_ALL_DIRECT: true,
URL_CACHE_RESET_QUERIES_DIRECT: true,
URL_CACHE_GET_QUERIES_DIRECT: true,
URL_CORE_CALCULATE_DIRECT: true,
URL_CORE_FINGAP_DIRECT: true,

View File

@ -24,7 +24,7 @@ function getUrls() {
URL_CRM_GRAPHQL_PROXY,
URL_CACHE_GET_QUERIES_DIRECT,
URL_CACHE_DELETE_QUERY_DIRECT,
URL_CACHE_FLUSH_ALL_DIRECT,
URL_CACHE_RESET_QUERIES_DIRECT,
} = serverRuntimeConfigSchema.parse(serverRuntimeConfig);
return {
@ -33,8 +33,8 @@ function getUrls() {
SENTRY_DSN,
URL_1C_TRANSTAX: URL_1C_TRANSTAX_DIRECT,
URL_CACHE_DELETE_QUERY: URL_CACHE_DELETE_QUERY_DIRECT,
URL_CACHE_FLUSH_ALL: URL_CACHE_FLUSH_ALL_DIRECT,
URL_CACHE_GET_QUERIES: URL_CACHE_GET_QUERIES_DIRECT,
URL_CACHE_RESET_QUERIES: URL_CACHE_RESET_QUERIES_DIRECT,
URL_CORE_CALCULATE: URL_CORE_CALCULATE_DIRECT,
URL_CORE_FINGAP: URL_CORE_FINGAP_DIRECT,
URL_CRM_CREATEKP: URL_CRM_CREATEKP_DIRECT,
@ -51,8 +51,8 @@ function getUrls() {
SENTRY_DSN,
URL_1C_TRANSTAX: withBasePath(urls.URL_1C_TRANSTAX_PROXY),
URL_CACHE_DELETE_QUERY: withBasePath(urls.URL_CACHE_DELETE_QUERY_PROXY),
URL_CACHE_FLUSH_ALL: withBasePath(urls.URL_CACHE_FLUSH_ALL_PROXY),
URL_CACHE_GET_QUERIES: withBasePath(urls.URL_CACHE_GET_QUERIES_PROXY),
URL_CACHE_RESET_QUERIES: withBasePath(urls.URL_CACHE_RESET_QUERIES_PROXY),
URL_CORE_CALCULATE: withBasePath(urls.URL_CORE_CALCULATE_PROXY),
URL_CORE_FINGAP: withBasePath(urls.URL_CORE_FINGAP_PROXY),
URL_CRM_CREATEKP: withBasePath(urls.URL_CRM_CREATEKP_PROXY),

View File

@ -1,7 +1,7 @@
module.exports = {
URL_1C_TRANSTAX_PROXY: '/api/1c/transtax',
URL_CACHE_DELETE_QUERY_PROXY: '/api/admin/cache/delete',
URL_CACHE_FLUSH_ALL_PROXY: '/api/admin/cache/flush-all',
URL_CACHE_RESET_QUERIES_PROXY: '/api/admin/cache/reset',
URL_CACHE_GET_QUERIES_PROXY: '/api/admin/cache/queries',
URL_CORE_CALCULATE_PROXY: '/api/core/calculate',
URL_CORE_FINGAP_PROXY: '/api/core/fingap',

View File

@ -75,8 +75,8 @@ module.exports = withSentryConfig(
source: urls.URL_CACHE_DELETE_QUERY_PROXY + '/:path*',
},
{
destination: env.URL_CACHE_FLUSH_ALL_DIRECT,
source: urls.URL_CACHE_FLUSH_ALL_PROXY,
destination: env.URL_CACHE_RESET_QUERIES_DIRECT,
source: urls.URL_CACHE_RESET_QUERIES_PROXY,
},
...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)),