Browse Source

Lead ID is omitable when create new.. (http POST) getLead by ID is added as a wrapper for crmGetEntity

master
Patrick Peng Sun 8 years ago
parent
commit
39f57a5fd9
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      crmLead.go

+ 4
- 4
crmLead.go View File

@@ -9,7 +9,7 @@ import (
)

type crmdLead struct {
ID string `json:"id"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Deleted bool `json:"deleted,omitempty"`
SalutationName string `json:"salutationName,omitempty"`
@@ -165,8 +165,8 @@ func crmPrepareLeadUploadHTTPHeader() (headers map[string]string) {
return headers
}

func crmGetLeadByID(id string) (r crmdLead, err error) {
resp, err := crmGetEntity("Lead", id)
err = json.Unmarshal([]byte(resp), &r)
func crmGetLead(id string) (r crmdLead, err error) {
entity, err := crmGetEntity("Lead", id)
r = entity.(crmdLead)
return
}

Loading…
Cancel
Save