All files / src/hooks/merchant-api/transferMoney useGetMerchantBankAccount.tsx

100% Statements 3/3
33.33% Branches 1/3
100% Functions 2/2
100% Lines 3/3

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      1x       111x     8x                      
import { customInstance } from "@services/api";
import { useQuery } from "react-query";
 
export const useGetMerchantBankAccount = (
  merchantId: number,
  approvedOnly = true,
) =>
  useQuery(
    ["get-merchants-bank-accounts", merchantId],
    async () =>
      await customInstance({
        url: `merchants/${merchantId}/bank-accounts${
          approvedOnly ? `?filter=status:"approved"` : ""
        }`,
        method: "GET",
      }),
    {
      refetchOnWindowFocus: false,
      retry: 0,
    },
  );