feat: prettier
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import {useQuery} from "@tanstack/react-query";
|
||||
import {BarcodeService} from "../../client";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { BarcodeService } from "../../client";
|
||||
|
||||
const useGetAllBarcodeTemplates = () => {
|
||||
const {data, error, isLoading, refetch} = useQuery({
|
||||
queryKey: ['getAllBarcodeTemplates'],
|
||||
const { data, error, isLoading, refetch } = useQuery({
|
||||
queryKey: ["getAllBarcodeTemplates"],
|
||||
queryFn: () => BarcodeService.getAllBarcodeTemplates(),
|
||||
select: (data) => data.templates
|
||||
select: data => data.templates,
|
||||
});
|
||||
const barcodeTemplates = isLoading || error || !data ? [] : data;
|
||||
return {barcodeTemplates, refetch}
|
||||
}
|
||||
return { barcodeTemplates, refetch };
|
||||
};
|
||||
|
||||
export default useGetAllBarcodeTemplates;
|
||||
export default useGetAllBarcodeTemplates;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {ProductService} from "../../client";
|
||||
import {useQuery} from "@tanstack/react-query";
|
||||
import { ProductService } from "../../client";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
export const useGetProductById = (id: number) => {
|
||||
const {data, error, isLoading, refetch} = useQuery({
|
||||
queryKey: ['getProductById', id],
|
||||
queryFn: () => ProductService.getProductById({productId: id}),
|
||||
select: (data) => data
|
||||
const { data, error, isLoading, refetch } = useQuery({
|
||||
queryKey: ["getProductById", id],
|
||||
queryFn: () => ProductService.getProductById({ productId: id }),
|
||||
select: data => data,
|
||||
});
|
||||
return {product: data, error, isLoading, refetch}
|
||||
}
|
||||
return { product: data, error, isLoading, refetch };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user