Skip to content
Snippets Groups Projects
Unverified Commit 9a60d394 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Update `dataset` RTKQuery API (#40356)

* Rename api to just `dataset`

We're going to use this api for both structured and native endpoints.

* Fix the input type
parent 4f04b6b1
Branches
Tags
No related merge requests found
import { Api } from "metabase/api";
import type { NativeQueryForm, StructuredQuery } from "metabase-types/api";
import type { NativeQueryForm, DatasetQuery } from "metabase-types/api";
export const nativeDatasetApi = Api.injectEndpoints({
export const datasetApi = Api.injectEndpoints({
endpoints: builder => ({
createNativeDataset: builder.mutation<NativeQueryForm, StructuredQuery>({
createNativeDataset: builder.mutation<NativeQueryForm, DatasetQuery>({
query: input => ({
method: "POST",
url: "/api/dataset/native",
......@@ -13,4 +13,4 @@ export const nativeDatasetApi = Api.injectEndpoints({
}),
});
export const { useCreateNativeDatasetMutation } = nativeDatasetApi;
export const { useCreateNativeDatasetMutation } = datasetApi;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment