Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

581 B
Raw Blame
import type {
  NativeQuerySnippet,
  RegularCollectionId,
} from "metabase-types/api";

export type NativeQuerySnippetDetails = {
  name?: string;
  description?: string | null;
  content: string;
  collection_id?: RegularCollectionId | null;
};

export function createSnippet({
  name = "Test snippet",
  description = null,
  content,
  collection_id = null,
}: NativeQuerySnippetDetails): Cypress.Chainable<
  Cypress.Response<NativeQuerySnippet>
> {
  return cy.request("POST", "/api/native-query-snippet", {
    name,
    description,
    content,
    collection_id,
  });
}