mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-12 19:48:26 +00:00
Fix: UI updated as per new query as entity change (#10621)
* fix: failing meven CI due to query as entity changes * formatting issue
This commit is contained in:
parent
551df24d35
commit
e706c81fcd
@ -46,7 +46,6 @@ export interface DatasetDetailsProps {
|
|||||||
owner: EntityReference;
|
owner: EntityReference;
|
||||||
description: string;
|
description: string;
|
||||||
tableProfile: Table['profile'];
|
tableProfile: Table['profile'];
|
||||||
tableQueries: Table['tableQueries'];
|
|
||||||
columns: Column[];
|
columns: Column[];
|
||||||
tier: TagLabel;
|
tier: TagLabel;
|
||||||
sampleData: TableData;
|
sampleData: TableData;
|
||||||
@ -57,7 +56,6 @@ export interface DatasetDetailsProps {
|
|||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
isTableProfileLoading?: boolean;
|
isTableProfileLoading?: boolean;
|
||||||
isSampleDataLoading?: boolean;
|
isSampleDataLoading?: boolean;
|
||||||
isQueriesLoading?: boolean;
|
|
||||||
isentityThreadLoading: boolean;
|
isentityThreadLoading: boolean;
|
||||||
feedCount: number;
|
feedCount: number;
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[];
|
entityFieldThreadCount: EntityFieldThreadCount[];
|
||||||
|
@ -27,10 +27,7 @@ import {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import {
|
import { getLatestTableProfileByFqn } from 'rest/tableAPI';
|
||||||
getLatestTableProfileByFqn,
|
|
||||||
getTableQueryByTableId,
|
|
||||||
} from 'rest/tableAPI';
|
|
||||||
import { getListTestCase } from 'rest/testAPI';
|
import { getListTestCase } from 'rest/testAPI';
|
||||||
import {
|
import {
|
||||||
DRAWER_NAVIGATION_OPTIONS,
|
DRAWER_NAVIGATION_OPTIONS,
|
||||||
@ -115,15 +112,9 @@ function TableSummary({
|
|||||||
|
|
||||||
const { profile, tableConstraints } = profileResponse;
|
const { profile, tableConstraints } = profileResponse;
|
||||||
|
|
||||||
const queriesResponse = await getTableQueryByTableId(
|
|
||||||
entityDetails.id || ''
|
|
||||||
);
|
|
||||||
|
|
||||||
const { tableQueries } = queriesResponse;
|
|
||||||
|
|
||||||
setTableDetails((prev) => {
|
setTableDetails((prev) => {
|
||||||
if (prev) {
|
if (prev) {
|
||||||
return { ...prev, profile, tableQueries, tableConstraints };
|
return { ...prev, profile, tableConstraints };
|
||||||
} else {
|
} else {
|
||||||
return {} as Table;
|
return {} as Table;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@ import {
|
|||||||
TagSource,
|
TagSource,
|
||||||
} from '../../../../generated/entity/data/table';
|
} from '../../../../generated/entity/data/table';
|
||||||
|
|
||||||
const mockDate = new Date('2023-01-03');
|
|
||||||
|
|
||||||
export const mockTableEntityDetails: Table = {
|
export const mockTableEntityDetails: Table = {
|
||||||
id: '8dd1f238-6ba0-46c6-a091-7db81f2a6bed',
|
id: '8dd1f238-6ba0-46c6-a091-7db81f2a6bed',
|
||||||
name: 'dim.api/client',
|
name: 'dim.api/client',
|
||||||
@ -79,24 +77,6 @@ export const mockTableEntityDetails: Table = {
|
|||||||
state: State.Confirmed,
|
state: State.Confirmed,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableQueries: [
|
|
||||||
{
|
|
||||||
query:
|
|
||||||
'select cust.customer_id, fact_order.order_id from dim_customer cust join fact_order on',
|
|
||||||
users: [],
|
|
||||||
vote: 1,
|
|
||||||
checksum: 'ff727cf70d5a7a9810704532f3571b82',
|
|
||||||
queryDate: mockDate,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
query:
|
|
||||||
'select sale.sale_id, cust.customer_id, fact_order.order_ir from shopify.',
|
|
||||||
users: [],
|
|
||||||
vote: 1,
|
|
||||||
checksum: 'e14e02c387dd8482d10c4ec7d3d4c69a',
|
|
||||||
queryDate: mockDate,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
service: {
|
service: {
|
||||||
id: '0875717c-5855-427c-8dd6-92d4cbfe7c51',
|
id: '0875717c-5855-427c-8dd6-92d4cbfe7c51',
|
||||||
type: 'databaseService',
|
type: 'databaseService',
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
import {
|
import {
|
||||||
findByTestId,
|
findByTestId,
|
||||||
findByText,
|
findByText,
|
||||||
// getByTestId,
|
|
||||||
queryByTestId,
|
queryByTestId,
|
||||||
render,
|
render,
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
|
import { Query } from 'generated/entity/data/query';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import QueryCard from './QueryCard';
|
import QueryCard from './QueryCard';
|
||||||
@ -36,7 +36,7 @@ const mockQueryData = {
|
|||||||
],
|
],
|
||||||
vote: 1,
|
vote: 1,
|
||||||
checksum: '0232b0368458aadb29230ccc531462c9',
|
checksum: '0232b0368458aadb29230ccc531462c9',
|
||||||
};
|
} as Query;
|
||||||
|
|
||||||
jest.mock('../schema-editor/SchemaEditor', () => {
|
jest.mock('../schema-editor/SchemaEditor', () => {
|
||||||
return jest.fn().mockReturnValue(<p>SchemaEditor</p>);
|
return jest.fn().mockReturnValue(<p>SchemaEditor</p>);
|
||||||
|
@ -12,17 +12,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { Query } from 'generated/entity/data/query';
|
||||||
// import { isUndefined } from 'lodash';
|
// import { isUndefined } from 'lodash';
|
||||||
import React, { FC, HTMLAttributes, useState } from 'react';
|
import React, { FC, HTMLAttributes, useState } from 'react';
|
||||||
// import { Link } from 'react-router-dom';
|
// import { Link } from 'react-router-dom';
|
||||||
// import { getUserPath } from '../../constants/constants';
|
// import { getUserPath } from '../../constants/constants';
|
||||||
import { CSMode } from '../../enums/codemirror.enum';
|
import { CSMode } from '../../enums/codemirror.enum';
|
||||||
import { SQLQuery } from '../../generated/entity/data/table';
|
|
||||||
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
||||||
import CopyToClipboardButton from '../buttons/CopyToClipboardButton/CopyToClipboardButton';
|
import CopyToClipboardButton from '../buttons/CopyToClipboardButton/CopyToClipboardButton';
|
||||||
import SchemaEditor from '../schema-editor/SchemaEditor';
|
import SchemaEditor from '../schema-editor/SchemaEditor';
|
||||||
interface QueryCardProp extends HTMLAttributes<HTMLDivElement> {
|
interface QueryCardProp extends HTMLAttributes<HTMLDivElement> {
|
||||||
query: SQLQuery;
|
query: Query;
|
||||||
}
|
}
|
||||||
const QueryCard: FC<QueryCardProp> = ({ className, query }) => {
|
const QueryCard: FC<QueryCardProp> = ({ className, query }) => {
|
||||||
const [expanded, setExpanded] = useState<boolean>(false);
|
const [expanded, setExpanded] = useState<boolean>(false);
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import { MOCK_TABLE } from '../../mocks/TableData.mock';
|
import { MOCK_TABLE_QUERY } from '../../mocks/TableData.mock';
|
||||||
import TableQueries from './TableQueries';
|
import TableQueries from './TableQueries';
|
||||||
|
|
||||||
const mockTableQueriesProp = {
|
const mockTableQueriesProp = {
|
||||||
@ -29,10 +29,10 @@ const mockTableQueriesProp = {
|
|||||||
jest.mock('./QueryCard', () => {
|
jest.mock('./QueryCard', () => {
|
||||||
return jest.fn().mockReturnValue(<p>QueryCard</p>);
|
return jest.fn().mockReturnValue(<p>QueryCard</p>);
|
||||||
});
|
});
|
||||||
jest.mock('rest/tableAPI', () => ({
|
jest.mock('rest/queryAPI', () => ({
|
||||||
getTableQueryByTableId: jest
|
getQueriesList: jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockImplementation(() => Promise.resolve(MOCK_TABLE)),
|
.mockImplementation(() => Promise.resolve({ data: MOCK_TABLE_QUERY })),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('Test TableQueries Component', () => {
|
describe('Test TableQueries Component', () => {
|
||||||
@ -46,7 +46,7 @@ describe('Test TableQueries Component', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Check if TableQueries component has n query card', async () => {
|
it('Check if TableQueries component has n query card', async () => {
|
||||||
const queriesLength = MOCK_TABLE.tableQueries?.length || 0;
|
const queriesLength = MOCK_TABLE_QUERY?.length || 0;
|
||||||
const { container } = render(<TableQueries {...mockTableQueriesProp} />, {
|
const { container } = render(<TableQueries {...mockTableQueriesProp} />, {
|
||||||
wrapper: MemoryRouter,
|
wrapper: MemoryRouter,
|
||||||
});
|
});
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
import { Col, Row } from 'antd';
|
import { Col, Row } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
|
import { Query } from 'generated/entity/data/query';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import React, { FC, useEffect, useState } from 'react';
|
import React, { FC, useEffect, useState } from 'react';
|
||||||
import { getTableQueryByTableId } from 'rest/tableAPI';
|
import { getQueriesList } from 'rest/queryAPI';
|
||||||
import { Table } from '../../generated/entity/data/table';
|
|
||||||
import { withLoader } from '../../hoc/withLoader';
|
import { withLoader } from '../../hoc/withLoader';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
@ -32,13 +32,13 @@ const TableQueries: FC<TableQueriesProp> = ({
|
|||||||
isTableDeleted,
|
isTableDeleted,
|
||||||
tableId,
|
tableId,
|
||||||
}: TableQueriesProp) => {
|
}: TableQueriesProp) => {
|
||||||
const [tableQueries, setTableQueries] = useState<Table['tableQueries']>([]);
|
const [tableQueries, setTableQueries] = useState<Query[]>([]);
|
||||||
const [isQueriesLoading, setIsQueriesLoading] = useState(true);
|
const [isQueriesLoading, setIsQueriesLoading] = useState(true);
|
||||||
|
|
||||||
const fetchTableQuery = async () => {
|
const fetchTableQuery = async () => {
|
||||||
try {
|
try {
|
||||||
const queries = await getTableQueryByTableId(tableId);
|
const queries = await getQueriesList({ entityId: tableId });
|
||||||
setTableQueries(queries.tableQueries ?? []);
|
setTableQueries(queries.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -98,7 +98,6 @@ export const RECREATE_INDEX_OPTIONS = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export const ENTITY_TREE_OPTIONS = [
|
export const ENTITY_TREE_OPTIONS = [
|
||||||
{
|
{
|
||||||
title: 'All',
|
title: 'All',
|
||||||
@ -114,7 +113,10 @@ export const ENTITY_TREE_OPTIONS = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const RE_INDEX_LANG_OPTIONS = map(SearchIndexMappingLanguage, (value) => ({
|
export const RE_INDEX_LANG_OPTIONS = map(
|
||||||
label: value,
|
SearchIndexMappingLanguage,
|
||||||
value,
|
(value) => ({
|
||||||
}));
|
label: value,
|
||||||
|
value,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
@ -191,14 +191,6 @@ export const MOCK_TABLE = {
|
|||||||
columnCount: 12,
|
columnCount: 12,
|
||||||
rowCount: 14567,
|
rowCount: 14567,
|
||||||
},
|
},
|
||||||
tableQueries: [
|
|
||||||
{
|
|
||||||
query:
|
|
||||||
'create table shopify.dim_address_clean as select address_id, shop_id, first_name, last_name, address1 as address, company, city, region, zip, country, phone from shopify.dim_address',
|
|
||||||
vote: 1,
|
|
||||||
checksum: 'cd59a9d0d0b8a245f7382264afac8bdc',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
sampleData: {
|
sampleData: {
|
||||||
columns: ['address_id', 'shop_id', 'first_name', 'last_name'],
|
columns: ['address_id', 'shop_id', 'first_name', 'last_name'],
|
||||||
rows: [
|
rows: [
|
||||||
@ -331,3 +323,12 @@ export const COLUMN_PROFILER_RESULT = [
|
|||||||
median: 7344.0,
|
median: 7344.0,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const MOCK_TABLE_QUERY = [
|
||||||
|
{
|
||||||
|
query:
|
||||||
|
'create table shopify.dim_address_clean as select address_id, shop_id, first_name, last_name, address1 as address, company, city, region, zip, country, phone from shopify.dim_address',
|
||||||
|
vote: 1,
|
||||||
|
checksum: 'cd59a9d0d0b8a245f7382264afac8bdc',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
@ -91,8 +91,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
const [isSampleDataLoading, setIsSampleDataLoading] =
|
const [isSampleDataLoading, setIsSampleDataLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [isTableQueriesLoading, setIsTableQueriesLoading] =
|
|
||||||
useState<boolean>(false);
|
|
||||||
const [isentityThreadLoading, setIsentityThreadLoading] =
|
const [isentityThreadLoading, setIsentityThreadLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [isTableProfileLoading, setIsTableProfileLoading] =
|
const [isTableProfileLoading, setIsTableProfileLoading] =
|
||||||
@ -137,7 +135,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
);
|
);
|
||||||
const [deleted, setDeleted] = useState<boolean>(false);
|
const [deleted, setDeleted] = useState<boolean>(false);
|
||||||
const [isError, setIsError] = useState(false);
|
const [isError, setIsError] = useState(false);
|
||||||
const [tableQueries, setTableQueries] = useState<Table['tableQueries']>([]);
|
|
||||||
const [entityThread, setEntityThread] = useState<Thread[]>([]);
|
const [entityThread, setEntityThread] = useState<Thread[]>([]);
|
||||||
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
const [feedCount, setFeedCount] = useState<number>(0);
|
||||||
@ -398,33 +395,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TabSpecificField.TABLE_QUERIES: {
|
|
||||||
if ((tableQueries?.length ?? 0) > 0) {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
setIsTableQueriesLoading(true);
|
|
||||||
getTableDetailsByFQN(tableFQN, tabField)
|
|
||||||
.then((res) => {
|
|
||||||
if (res) {
|
|
||||||
const { tableQueries } = res;
|
|
||||||
setTableQueries(tableQueries);
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages']['fetch-table-queries-error']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
err,
|
|
||||||
jsonData['api-error-messages']['fetch-table-queries-error']
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.finally(() => setIsTableQueriesLoading(false));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case TabSpecificField.ACTIVITY_FEED: {
|
case TabSpecificField.ACTIVITY_FEED: {
|
||||||
getFeedData();
|
getFeedData();
|
||||||
|
|
||||||
@ -748,7 +718,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
followTableHandler={followTable}
|
followTableHandler={followTable}
|
||||||
followers={followers}
|
followers={followers}
|
||||||
handleExtensionUpdate={handleExtentionUpdate}
|
handleExtensionUpdate={handleExtentionUpdate}
|
||||||
isQueriesLoading={isTableQueriesLoading}
|
|
||||||
isSampleDataLoading={isSampleDataLoading}
|
isSampleDataLoading={isSampleDataLoading}
|
||||||
isTableProfileLoading={isTableProfileLoading}
|
isTableProfileLoading={isTableProfileLoading}
|
||||||
isentityThreadLoading={isentityThreadLoading}
|
isentityThreadLoading={isentityThreadLoading}
|
||||||
@ -762,7 +731,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
slashedTableName={slashedTableName}
|
slashedTableName={slashedTableName}
|
||||||
tableDetails={tableDetails}
|
tableDetails={tableDetails}
|
||||||
tableProfile={tableProfile}
|
tableProfile={tableProfile}
|
||||||
tableQueries={tableQueries}
|
|
||||||
tableTags={tableTags}
|
tableTags={tableTags}
|
||||||
tableType={tableType}
|
tableType={tableType}
|
||||||
tagUpdateHandler={onTagUpdate}
|
tagUpdateHandler={onTagUpdate}
|
||||||
|
@ -12,15 +12,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Form, Input, Modal, Select, TreeSelect } from 'antd';
|
import { Form, Input, Modal, Select, TreeSelect } from 'antd';
|
||||||
import { SearchIndexMappingLanguage } from 'generated/configuration/elasticSearchConfiguration';
|
|
||||||
import { map } from 'lodash';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
ELASTIC_SEARCH_INITIAL_VALUES,
|
ELASTIC_SEARCH_INITIAL_VALUES,
|
||||||
RECREATE_INDEX_OPTIONS,
|
|
||||||
ENTITY_TREE_OPTIONS,
|
ENTITY_TREE_OPTIONS,
|
||||||
RE_INDEX_LANG_OPTIONS
|
RECREATE_INDEX_OPTIONS,
|
||||||
|
RE_INDEX_LANG_OPTIONS,
|
||||||
} from '../../constants/elasticsearch.constant';
|
} from '../../constants/elasticsearch.constant';
|
||||||
import { CreateEventPublisherJob } from '../../generated/api/createEventPublisherJob';
|
import { CreateEventPublisherJob } from '../../generated/api/createEventPublisherJob';
|
||||||
|
|
||||||
@ -39,8 +37,6 @@ const ReIndexAllModal = ({
|
|||||||
}: ReIndexAllModalInterface) => {
|
}: ReIndexAllModalInterface) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
centered
|
centered
|
||||||
|
@ -198,7 +198,6 @@ const TourPage = () => {
|
|||||||
tableProfile={
|
tableProfile={
|
||||||
mockDatasetData.tableProfile as unknown as Table['profile']
|
mockDatasetData.tableProfile as unknown as Table['profile']
|
||||||
}
|
}
|
||||||
tableQueries={[]}
|
|
||||||
tableTags={mockDatasetData.tableTags}
|
tableTags={mockDatasetData.tableTags}
|
||||||
tableType={mockDatasetData.tableType as TableType}
|
tableType={mockDatasetData.tableType as TableType}
|
||||||
tagUpdateHandler={handleCountChange}
|
tagUpdateHandler={handleCountChange}
|
||||||
|
49
openmetadata-ui/src/main/resources/ui/src/rest/queryAPI.ts
Normal file
49
openmetadata-ui/src/main/resources/ui/src/rest/queryAPI.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 Collate.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { AxiosResponse } from 'axios';
|
||||||
|
import { CreateQuery } from 'generated/api/data/createQuery';
|
||||||
|
import { Query } from 'generated/entity/data/query';
|
||||||
|
import { Include } from 'generated/type/include';
|
||||||
|
import { PagingResponse } from 'Models';
|
||||||
|
import APIClient from './index';
|
||||||
|
|
||||||
|
type Params = {
|
||||||
|
fields?: string;
|
||||||
|
limit?: number;
|
||||||
|
before?: string;
|
||||||
|
after?: string;
|
||||||
|
include?: Include;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListQueriesParams = Params & {
|
||||||
|
entityId?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const BASE_URL = '/queries';
|
||||||
|
|
||||||
|
export const getQueriesList = async (params?: ListQueriesParams) => {
|
||||||
|
const response = await APIClient.get<PagingResponse<Query[]>>(BASE_URL, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
|
export const postQuery = async (query: CreateQuery) => {
|
||||||
|
const response = await APIClient.post<CreateQuery, AxiosResponse<Query>>(
|
||||||
|
BASE_URL,
|
||||||
|
query
|
||||||
|
);
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
};
|
@ -218,12 +218,6 @@ export const getSampleDataByTableId = async (id: string) => {
|
|||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getTableQueryByTableId = async (id: string) => {
|
|
||||||
const response = await APIClient.get<Table>(`/tables/${id}/tableQuery`);
|
|
||||||
|
|
||||||
return response.data;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getLatestTableProfileByFqn = async (fqn: string) => {
|
export const getLatestTableProfileByFqn = async (fqn: string) => {
|
||||||
const encodedFQN = encodeURIComponent(fqn);
|
const encodedFQN = encodeURIComponent(fqn);
|
||||||
const response = await APIClient.get<Table>(
|
const response = await APIClient.get<Table>(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user