File size: 486 Bytes
05c5ed5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use client";
import useSWR, { SWRConfiguration } from "swr";
import { appStore } from "@/app/store";
import { fetcher } from "lib/utils";

export function useWorkflowToolList(options?: SWRConfiguration) {
  return useSWR("/api/workflow/tools", fetcher, {
    errorRetryCount: 0,
    revalidateOnFocus: false,
    focusThrottleInterval: 1000 * 60 * 30,
    fallbackData: [],
    onSuccess: (data) => {
      appStore.setState({ workflowToolList: data });
    },
    ...options,
  });
}