Skip to content

Commit

Permalink
fix comment adding
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermsi1337 committed May 5, 2019
1 parent 37423c8 commit 497f63c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
7 changes: 2 additions & 5 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ type Order struct {
ApiClient *ApiClient
}

func (order *Order) AddComment(comment string) error {
func (order *Order) AddComment(statusHistory types.StatusHistory) error {
endpoint := order.Route + orderComments
httpClient := order.ApiClient.HttpClient

payLoad := types.StatusHistory{
Comment: comment,
ParentID: order.ID,
}
payLoad := statusHistory

resp, err := httpClient.R().SetBody(payLoad).Post(endpoint)
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions types/status_history.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package types

type StatusHistory struct {
Comment string `json:"comment"`
CreatedAt string `json:"created_at"`
EntityID int `json:"entity_id"`
EntityName string `json:"entity_name"`
IsCustomerNotified int `json:"is_customer_notified"`
IsVisibleOnFront int `json:"is_visible_on_front"`
ParentID int `json:"parent_id"`
Status string `json:"status"`
ExtensionAttributes ExtensionAttributes `json:"extension_attributes"`
Comment string `json:"comment,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
EntityID int `json:"entity_id,omitempty"`
EntityName string `json:"entity_name,omitempty"`
IsCustomerNotified int `json:"is_customer_notified,omitempty"`
IsVisibleOnFront int `json:"is_visible_on_front,omitempty"`
ParentID int `json:"parent_id,omitempty"`
Status string `json:"status,omitempty"`
ExtensionAttributes ExtensionAttributes `json:"extension_attributes,omitempty"`
}

0 comments on commit 497f63c

Please sign in to comment.