import axios from "../../../config/axios";
import { CreateBankType } from "../types/CardBankTypes";

export const createCardBank = async (params: CreateBankType) => {
  const { data } = await axios.post(`/payments/bank-account`, params);
  return data;
};

export const getCardBanks = async () => {
  const { data } = await axios.get(`/payments/bank-account`);
  return data;
};

export const getCardBankDetail = async (id: string) => {
  const { data } = await axios.get(`/payments/bank-account/${id}`);
  return data;
};

export const updateCardBank = async (id: string, params: CreateBankType) => {
  const { data } = await axios.patch(`/payments/bank-account/${id}`, params);
  return data;
};
