import {BarcodeService} from "../../../client";
import {useQuery} from "@tanstack/react-query";

const useBarcodeTemplateAttributesList = () => {
    const {isLoading, data, error, refetch} = useQuery({
        queryKey: ['getAllBarcodeTemplateAttributes'],
        queryFn: BarcodeService.getAllBarcodeTemplateAttributes
    });

    const barcodeTemplateAttributes = isLoading || error || !data ? [] : data.attributes;

    return {barcodeTemplateAttributes, refetch}
}
export default useBarcodeTemplateAttributesList;