chore: fix failing typecheck

This commit is contained in:
TzeYiing authored and Ziinc committed 2022-12-22 22:49:00 +08:00
1 parent 179402ef92
commit d52154f686
2 files changed
+5 -5

No files matched your search

@@ -28,12 +28,12 @@ export interface PresetConfig {
queries: Record<string, DbQuery | LogsQuery>
}
interface DbQuery {
export interface DbQuery {
queryType: 'db'
sql: (params: BaseReportParams) => string
sql: string | ((params: BaseReportParams) => string)
}
interface LogsQuery {
export interface LogsQuery {
queryType: 'logs'
sql: string
}
+2 -2
View File
@@ -4,12 +4,12 @@ import {
DbQueryData,
DbQueryHandler,
MetaQueryResponse,
PresetSql,
DbQuery,
} from 'components/interfaces/Reports/Reports.types'
import { useStore } from 'hooks'
import useSWR from 'swr'
type UseDbQuery = (sql: PresetSql, params?: BaseReportParams) => [DbQueryData, DbQueryHandler]
type UseDbQuery = (sql: DbQuery['sql'], params?: BaseReportParams) => [DbQueryData, DbQueryHandler]
const useDbQuery: UseDbQuery = (sql, params = DEFAULT_QUERY_PARAMS) => {
const { meta } = useStore()