Skip to content

Commit 12495ec

Browse files
committed
Merge branch 'v5_staging' into add-groups
2 parents 5163792 + 1e9cd61 commit 12495ec

10 files changed

+6
-8
lines changed

contact/contact.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func Create(c *messagebird.Client, contactRequest *Request) (*Contact, error) {
7474
}
7575

7676
contact := &Contact{}
77-
7877
if err := c.Request(contact, http.MethodPost, path, contactRequest); err != nil {
7978
return nil, err
8079
}
@@ -109,10 +108,11 @@ func List(c *messagebird.Client, options *ListOptions) (*ContactList, error) {
109108
}
110109

111110
contactList := &ContactList{}
111+
if err = c.Request(contactList, http.MethodGet, path+"?"+query, nil); err != nil {
112+
return nil, err
113+
}
112114

113-
err = c.Request(contactList, http.MethodGet, path+"?"+query, nil)
114-
115-
return contactList, err
115+
return contactList, nil
116116
}
117117

118118
func listQuery(options *ListOptions) (string, error) {
@@ -135,7 +135,6 @@ func listQuery(options *ListOptions) (string, error) {
135135
// Read retrieves the information of an existing contact.
136136
func Read(c *messagebird.Client, id string) (*Contact, error) {
137137
contact := &Contact{}
138-
139138
if err := c.Request(contact, http.MethodGet, path+"/"+id, nil); err != nil {
140139
return nil, err
141140
}
@@ -147,7 +146,6 @@ func Read(c *messagebird.Client, id string) (*Contact, error) {
147146
// Do not set any values that should not be updated.
148147
func Update(c *messagebird.Client, id string, contactRequest *Request) (*Contact, error) {
149148
contact := &Contact{}
150-
151149
if err := c.Request(contact, http.MethodPatch, path+"/"+id, contactRequest); err != nil {
152150
return nil, err
153151
}

message/message.go renamed to sms/message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package message
1+
package sms
22

33
import (
44
"errors"

message/message_test.go renamed to sms/message_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package message
1+
package sms
22

33
import (
44
"net/http"
File renamed without changes.

0 commit comments

Comments
 (0)