diff --git a/app/api/core/services/osmosis/osmosis.service.ts b/app/api/core/services/osmosis/osmosis.service.ts index 37ee0fb8..9013ec8f 100644 --- a/app/api/core/services/osmosis/osmosis.service.ts +++ b/app/api/core/services/osmosis/osmosis.service.ts @@ -28,7 +28,7 @@ export namespace OsmosisService { return errorHandleWrapper( HttpRequester.get.bind( null, - constructUrl(endpoint, createUrlParams({ tf: payload.range })) + constructUrl(endpoint, createUrlParams({ tf: payload.range.toString() })) ) ); } diff --git a/app/api/core/utils/create-url-params.ts b/app/api/core/utils/create-url-params.ts index a2e79408..394c93fe 100644 --- a/app/api/core/utils/create-url-params.ts +++ b/app/api/core/utils/create-url-params.ts @@ -1,5 +1,6 @@ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function createUrlParams (params: any): string { +type URLSearchParamInit = string | URLSearchParams | string[][] | Record | undefined; + +export function createUrlParams (params: URLSearchParamInit): string { const url = new URLSearchParams(params); return url.toString(); } diff --git a/app/api/core/utils/exception-filter.ts b/app/api/core/utils/exception-filter.ts index 09de6348..b4e2dc16 100644 --- a/app/api/core/utils/exception-filter.ts +++ b/app/api/core/utils/exception-filter.ts @@ -4,7 +4,7 @@ import { NextResponse } from 'next/server'; import { HttpErrorMessage } from '@core/enums/http-error-message.enum'; import { HttpStatus } from '@core/enums/http-status.enum'; -export async function exceptionFilter (fn: any) { +export async function exceptionFilter (fn: () => T) { try { return await fn(); // just to catch all error at this step } catch (e: any) { diff --git a/app/api/core/utils/schema-validate.ts b/app/api/core/utils/schema-validate.ts index 1f1e57f6..bcc127d5 100644 --- a/app/api/core/utils/schema-validate.ts +++ b/app/api/core/utils/schema-validate.ts @@ -12,7 +12,7 @@ export function schemaValidate (schema: ZodSchema, value: unknown) { throw new BadRequestException(errorView(res)); } -function errorView (value: SafeParseError): string { +function errorView (value: SafeParseError): string { const flattenErrors = value.error.flatten(); let message = 'Passed fields didn\'t match current schema:';