import { API_ROOT } from 'config'
import { callApi } from 'helpers'

export type Card = {
  brand: string,
  default: boolean,
  id: string,
  last4: string,
}

export type Cards = Array<Card>

export const getCardsList = async (): Promise<Cards> => {
  const config = {
    method: 'GET',
  }

  return callApi({
    config,
    url: `${API_ROOT}/account/get-cards`,
  })
}
