import { dataMachine } from "./dataMachine" ; import { httpClient } from "../utils/asyncUtils" ; import { isEmpty , omit } from "lodash/fp" ; export const contactsTransactionsMachine = dataMachine ( "contactsTransactions" ) . withConfig ( { services : { fetchData : async ( ctx , event ) => { const payload = omit ( "type" , event ) ; const resp = await httpClient . get ( `http://localhost:3001/transactions/contacts` , { params : ! isEmpty ( payload ) ? payload : undefined , } ) ; return resp . data ; } , } , } ) ;