forked from github/plane
ec3cad1f25
* chore: applying filters from the route params to the global issue filters store and Typos * chore: enabled posthog * fix: labels disbaled and loader while creating the label in isse detail and relation modal loader and mutation issue
29 lines
920 B
TypeScript
29 lines
920 B
TypeScript
import useSWR from "swr";
|
|
import { useEstimate, useLabel, useProjectState } from "./store";
|
|
|
|
export const useWorkspaceIssueProperties = (workspaceSlug: string | string[] | undefined) => {
|
|
const { fetchWorkspaceLabels } = useLabel();
|
|
|
|
const { fetchWorkspaceStates } = useProjectState();
|
|
|
|
const { fetchWorkspaceEstimates } = useEstimate();
|
|
|
|
// fetch workspace labels
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_LABELS_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceLabels(workspaceSlug.toString()) : null
|
|
);
|
|
|
|
// fetch workspace states
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_STATES_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceStates(workspaceSlug.toString()) : null
|
|
);
|
|
|
|
// fetch workspace estimates
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_ESTIMATES_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceEstimates(workspaceSlug.toString()) : null
|
|
);
|
|
};
|