urls: delete URL_CACHE_GET_QUERY_VALUE
This commit is contained in:
parent
9d6581ad57
commit
82e35ed2f8
@ -110,25 +110,6 @@ export class ProxyController {
|
||||
}
|
||||
}
|
||||
|
||||
@Delete('/delete-queries-by-key')
|
||||
public async deleteQueriesByKey(
|
||||
@Query('queriesGroup') queriesGroup: string,
|
||||
@Res() reply: FastifyReply,
|
||||
) {
|
||||
try {
|
||||
const allQueries = await this.getAllQueries();
|
||||
const { queries } = allQueries[queriesGroup];
|
||||
|
||||
queries.forEach(async (query) => {
|
||||
await this.cacheManager.del(query);
|
||||
});
|
||||
|
||||
return reply.send('ok');
|
||||
} catch (error) {
|
||||
throw new HttpException(error, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@Get('/get-query-value')
|
||||
public async getQueryValue(
|
||||
@Query('queryKey') queryKey: string,
|
||||
|
||||
11
apps/web/api/cache/query.ts
vendored
11
apps/web/api/cache/query.ts
vendored
@ -7,7 +7,6 @@ const {
|
||||
URL_CACHE_GET_QUERIES,
|
||||
URL_CACHE_DELETE_QUERY,
|
||||
URL_CACHE_RESET_QUERIES,
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY,
|
||||
URL_CACHE_GET_QUERY_VALUE,
|
||||
} = getUrls();
|
||||
|
||||
@ -31,16 +30,6 @@ export function reset() {
|
||||
return withHandleError(axios.delete(URL_CACHE_RESET_QUERIES)).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export function deleteQueriesByKey(queriesGroup: string) {
|
||||
return withHandleError(
|
||||
axios.delete(URL_CACHE_DELETE_QUERIES_BY_KEY, {
|
||||
params: {
|
||||
queriesGroup,
|
||||
},
|
||||
})
|
||||
).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export function getQueryValue(queryKey: string, { signal }: { signal: AbortSignal }) {
|
||||
return withHandleError(
|
||||
axios.get<object>(URL_CACHE_GET_QUERY_VALUE, {
|
||||
|
||||
@ -7,11 +7,10 @@ const envSchema = z.object({
|
||||
SENTRY_DSN: z.string(),
|
||||
SENTRY_ENVIRONMENT: z.string(),
|
||||
URL_1C_TRANSTAX_DIRECT: z.string(),
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY_DIRECT: z.string(),
|
||||
URL_CACHE_DELETE_QUERY_DIRECT: z.string(),
|
||||
URL_CACHE_GET_QUERIES_DIRECT: z.string(),
|
||||
URL_CACHE_RESET_QUERIES_DIRECT: z.string(),
|
||||
URL_CACHE_GET_QUERY_VALUE_DIRECT: z.string(),
|
||||
URL_CACHE_RESET_QUERIES_DIRECT: z.string(),
|
||||
URL_CORE_CALCULATE_DIRECT: z.string(),
|
||||
URL_CORE_FINGAP_DIRECT: z.string(),
|
||||
URL_CRM_CREATEKP_DIRECT: z.string(),
|
||||
|
||||
@ -13,7 +13,6 @@ const serverRuntimeConfigSchema = envSchema.pick({
|
||||
SENTRY_DSN: true,
|
||||
SENTRY_ENVIRONMENT: true,
|
||||
URL_1C_TRANSTAX_DIRECT: true,
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY_DIRECT: true,
|
||||
URL_CACHE_DELETE_QUERY_DIRECT: true,
|
||||
URL_CACHE_GET_QUERIES_DIRECT: true,
|
||||
URL_CACHE_GET_QUERY_VALUE_DIRECT: true,
|
||||
|
||||
@ -25,7 +25,6 @@ function getUrls() {
|
||||
URL_CACHE_GET_QUERIES_DIRECT,
|
||||
URL_CACHE_DELETE_QUERY_DIRECT,
|
||||
URL_CACHE_RESET_QUERIES_DIRECT,
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY_DIRECT,
|
||||
URL_CACHE_GET_QUERY_VALUE_DIRECT,
|
||||
} = serverRuntimeConfigSchema.parse(serverRuntimeConfig);
|
||||
|
||||
@ -34,7 +33,6 @@ function getUrls() {
|
||||
PORT,
|
||||
SENTRY_DSN,
|
||||
URL_1C_TRANSTAX: URL_1C_TRANSTAX_DIRECT,
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY: URL_CACHE_DELETE_QUERIES_BY_KEY_DIRECT,
|
||||
URL_CACHE_DELETE_QUERY: URL_CACHE_DELETE_QUERY_DIRECT,
|
||||
URL_CACHE_GET_QUERIES: URL_CACHE_GET_QUERIES_DIRECT,
|
||||
URL_CACHE_GET_QUERY_VALUE: URL_CACHE_GET_QUERY_VALUE_DIRECT,
|
||||
@ -54,7 +52,6 @@ function getUrls() {
|
||||
BASE_PATH,
|
||||
SENTRY_DSN,
|
||||
URL_1C_TRANSTAX: withBasePath(urls.URL_1C_TRANSTAX_PROXY),
|
||||
URL_CACHE_DELETE_QUERIES_BY_KEY: withBasePath(urls.URL_CACHE_DELETE_QUERIES_BY_KEY_PROXY),
|
||||
URL_CACHE_DELETE_QUERY: withBasePath(urls.URL_CACHE_DELETE_QUERY_PROXY),
|
||||
URL_CACHE_GET_QUERIES: withBasePath(urls.URL_CACHE_GET_QUERIES_PROXY),
|
||||
URL_CACHE_GET_QUERY_VALUE: withBasePath(urls.URL_CACHE_GET_QUERY_VALUE_PROXY),
|
||||
|
||||
@ -78,10 +78,6 @@ module.exports = withSentryConfig(
|
||||
destination: env.URL_CACHE_RESET_QUERIES_DIRECT,
|
||||
source: urls.URL_CACHE_RESET_QUERIES_PROXY,
|
||||
},
|
||||
{
|
||||
destination: env.URL_CACHE_DELETE_QUERIES_BY_KEY_DIRECT + '/:path*',
|
||||
source: urls.URL_CACHE_DELETE_QUERIES_BY_KEY_PROXY + '/:path*',
|
||||
},
|
||||
{
|
||||
destination: env.URL_CACHE_GET_QUERY_VALUE_DIRECT,
|
||||
source: urls.URL_CACHE_GET_QUERY_VALUE_PROXY,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user