Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

668 B
Raw Blame
import { useQuery } from "@tanstack/react-query";
import getCustomFieldValuesByProject from "@/fetchers/custom-field/get-custom-field-values-by-project";

export type CustomFieldValue = {
  id: string;
  taskId: string;
  fieldId: string;
  value: string | null;
  fieldName: string;
  fieldPosition: number;
  fieldType: string;
  fieldOptions: unknown;
};

function useGetCustomFieldValuesByProject(projectId: string) {
  return useQuery<CustomFieldValue[]>({
    queryKey: ["custom-field-values", projectId],
    queryFn: () => getCustomFieldValuesByProject({ projectId }),
    enabled: Boolean(projectId),
  });
}

export default useGetCustomFieldValuesByProject;