Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 14x 67x 3x 3x 3x 67x | import { QKEY_BUSINESS_PROFILE_BY_ID } from "@constants/queryKeys";
import { getLegalEntityByID } from "@services/api/businessProfile";
import { useQuery } from "react-query";
const useFindBusinessProfileById = ({
id,
merchantId,
}: {
id?: number;
merchantId?: number;
}) => {
const { data, isLoading, isError, refetch } = useQuery(
[QKEY_BUSINESS_PROFILE_BY_ID, id, merchantId],
async () => {
Iif (!id || !merchantId) return;
const data = await getLegalEntityByID(id, merchantId);
return data;
},
{
refetchOnWindowFocus: false,
enabled: !!id && !!merchantId,
},
);
return { data, isLoading, isError, refetch };
};
export default useFindBusinessProfileById;
|