@@ -77,7 +77,7 @@ func contactFieldParamsFromCmd(cmd *cobra.Command) (contactFieldParams, error) {
7777// find
7878
7979func runContactsFind (cfg * config.Config , email , userID string ) ([]api.Contact , error ) {
80- return api . NewClient (cfg . EndpointURL , cfg . APIKey , cfg . Debug ).FindContacts (api.FindContactParams {
80+ return newAPIClient (cfg ).FindContacts (api.FindContactParams {
8181 Email : email ,
8282 UserID : userID ,
8383 })
@@ -149,7 +149,7 @@ type contactCreateResult struct {
149149}
150150
151151func runContactsCreate (cfg * config.Config , req api.CreateContactRequest ) (string , error ) {
152- return api . NewClient (cfg . EndpointURL , cfg . APIKey , cfg . Debug ).CreateContact (req )
152+ return newAPIClient (cfg ).CreateContact (req )
153153}
154154
155155var contactsCreateCmd = & cobra.Command {
@@ -196,7 +196,7 @@ var contactsCreateCmd = &cobra.Command{
196196// update
197197
198198func runContactsUpdate (cfg * config.Config , req api.UpdateContactRequest ) error {
199- return api . NewClient (cfg . EndpointURL , cfg . APIKey , cfg . Debug ).UpdateContact (req )
199+ return newAPIClient (cfg ).UpdateContact (req )
200200}
201201
202202var contactsUpdateCmd = & cobra.Command {
@@ -244,7 +244,7 @@ var contactsUpdateCmd = &cobra.Command{
244244// delete
245245
246246func runContactsDelete (cfg * config.Config , email , userID string ) error {
247- return api . NewClient (cfg . EndpointURL , cfg . APIKey , cfg . Debug ).DeleteContact (email , userID )
247+ return newAPIClient (cfg ).DeleteContact (email , userID )
248248}
249249
250250var contactsDeleteCmd = & cobra.Command {
0 commit comments