This commit is contained in:
Andrey Parhomenko 2024-06-05 22:16:47 +05:00
parent cb8446b817
commit 7d8afae5a5

View file

@ -19,14 +19,20 @@ func (client *Client) GetLeadTuples(
"/api/v4/leads?%s", "/api/v4/leads?%s",
urlenc.Join(opts...).Encode, urlenc.Join(opts...).Encode,
) )
return client.GetLeadTuplesByFuncURL( return client.GetLeadTuplesByURL(res)
}
func (client *Client) GetLeadTuplesByURL(
u string,
) ([]LeadTuple, NextFunc[[]LeadTuple], error) {
return client.getLeadTuplesByFuncURL(
func() ([]Lead, NextFunc[[]Lead], error){ func() ([]Lead, NextFunc[[]Lead], error){
return client.GetLeadsByURL(res) return client.GetLeadsByURL(u)
}, },
) )
} }
func (client *Client) GetLeadTuplesByFuncURL( func (client *Client) getLeadTuplesByFuncURL(
// The function describes way of getting leads. // The function describes way of getting leads.
callback func() ( callback func() (
[]Lead, []Lead,
@ -122,7 +128,7 @@ func (client *Client) GetLeadTuplesByFuncURL(
if next != nil { if next != nil {
fn = NextFunc[[]LeadTuple]( fn = NextFunc[[]LeadTuple](
func() ([]LeadTuple, NextFunc[[]LeadTuple], error) { func() ([]LeadTuple, NextFunc[[]LeadTuple], error) {
return client.GetLeadTuplesByFuncURL( return client.getLeadTuplesByFuncURL(
next, next,
) )
}, },