From 2abc4d094727abe60cfccb57093ecc59b6bf9425 Mon Sep 17 00:00:00 2001
From: Dmitry Dmitriev
Date: Fri, 15 Jan 2021 11:56:14 +0300
Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?=
=?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?=
=?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D0=B9=20=D0=B8=20?=
=?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=BE=D0=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
amo/amocrm.go | 2 +-
models/companies/companies.go | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/amo/amocrm.go b/amo/amocrm.go
index 72e08c8..5db7e34 100644
--- a/amo/amocrm.go
+++ b/amo/amocrm.go
@@ -62,7 +62,7 @@ func (client *AmoClient) GetCompany(companyId string, query string) (*companies.
}
func (client *AmoClient) UpdateCompany(company *companies.Company) error {
- return client.updateEntity("/api/v4/contacts", company.ID, company)
+ return client.updateEntity("/api/v4/companies", company.ID, company)
}
func (client *AmoClient) GetContact(contactId string, query string) (*contacts.Contact, error) {
diff --git a/models/companies/companies.go b/models/companies/companies.go
index b9bd409..b05004e 100644
--- a/models/companies/companies.go
+++ b/models/companies/companies.go
@@ -4,18 +4,18 @@ import "github.com/qdimka/go-amo/models/common"
type Company struct {
ID int `json:"id"`
- Name string `json:"name"`
- ResponsibleUserID int `json:"responsible_user_id"`
- GroupID int `json:"group_id"`
- CreatedBy int `json:"created_by"`
- UpdatedBy int `json:"updated_by"`
- CreatedAt int `json:"created_at"`
- UpdatedAt int `json:"updated_at"`
- ClosestTaskAt interface{} `json:"closest_task_at"`
- CustomFieldsValues []common.CustomFieldsValue `json:"custom_fields_values"`
- AccountID int `json:"account_id"`
- Links Links `json:"_links"`
- Embedded Embedded `json:"_embedded"`
+ Name string `json:"name,omitempty"`
+ ResponsibleUserID int `json:"responsible_user_id,omitempty"`
+ GroupID int `json:"group_id,omitempty"`
+ CreatedBy int `json:"created_by,omitempty"`
+ UpdatedBy int `json:"updated_by,omitempty"`
+ CreatedAt int `json:"created_at,omitempty"`
+ UpdatedAt int `json:"updated_at,omitempty"`
+ ClosestTaskAt interface{} `json:"closest_task_at,omitempty"`
+ CustomFieldsValues []common.CustomFieldsValue `json:"custom_fields_values,omitempty"`
+ AccountID int `json:"account_id,omitempty"`
+ Links Links `json:"_links,omitempty"`
+ Embedded Embedded `json:"_embedded,omitempty"`
}
type Self struct {