import camelcaseKeys from 'camelcase-keys' ; import { api } from './' ; export interface Affiliate { name : string ; logoUrl ? : string ; logoLink ? : string ; } export async function findAffiliateByCode ( code ) { return api . get ( `affiliates/${ code }` ) . json ( ) . then ( ( res ) => camelcaseKeys ( res , { deep : true } ) ) ; }