mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-21 00:46:39 -05:00
17 lines
356 B
TypeScript
17 lines
356 B
TypeScript
import useSWR from "swr";
|
|
import { fetcher } from "./utils";
|
|
|
|
export const usePipelines = (formId: string) => {
|
|
const { data, error, mutate } = useSWR(
|
|
() => `/api/forms/${formId}/pipelines`,
|
|
fetcher
|
|
);
|
|
|
|
return {
|
|
pipelines: data,
|
|
isLoadingPipelines: !error && !data,
|
|
isErrorPipelines: error,
|
|
mutatePipeliness: mutate,
|
|
};
|
|
};
|