Skip to content

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

485 B
Raw Blame
import fetchMock from "fetch-mock";

import type { CollectionId, Timeline } from "metabase-types/api";

type TimelineResponse = Timeline[] | (() => Promise<Timeline[]>);

export function setupTimelinesEndpoints(response: TimelineResponse) {
  fetchMock.get("path:/api/timeline", response);
}

export function setupCollectionTimelinesEndpoint(
  collectionId: CollectionId,
  response: TimelineResponse,
) {
  fetchMock.get(`path:/api/timeline/collection/${collectionId}`, response);
}