mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
b3ac9def8d
* dev: workspace states and estimates * refactor issue dropdown logic to help work properly with issues on global level * fix: project labels response change * fix label type * change store computed actions to computed functions from mobx-utils * fix: state response change * chore: project and workspace state change * fix state and label types * chore: state and label serializer change * modify state and label types * fix dropdown reset on project id change * fix label sort order --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com> Co-authored-by: Rahul R <rahulr@Rahuls-MacBook-Pro.local> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Rahul R <rahul.ramesha@plane.so>
29 lines
921 B
TypeScript
29 lines
921 B
TypeScript
import useSWR from "swr";
|
|
import { useEstimate, useLabel, useProjectState } from "./store";
|
|
|
|
export const useWorskspaceIssueProperties = (workspaceSlug: string | string[] | undefined) => {
|
|
const { fetchWorkspaceLabels } = useLabel();
|
|
|
|
const { fetchWorkspaceStates } = useProjectState();
|
|
|
|
const { fetchWorskpaceEstimates } = 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 ? () => fetchWorskpaceEstimates(workspaceSlug.toString()) : null
|
|
);
|
|
};
|