@@ -74,7 +74,6 @@ func Create(c *messagebird.Client, contactRequest *Request) (*Contact, error) {
74
74
}
75
75
76
76
contact := & Contact {}
77
-
78
77
if err := c .Request (contact , http .MethodPost , path , contactRequest ); err != nil {
79
78
return nil , err
80
79
}
@@ -109,10 +108,11 @@ func List(c *messagebird.Client, options *ListOptions) (*ContactList, error) {
109
108
}
110
109
111
110
contactList := & ContactList {}
111
+ if err = c .Request (contactList , http .MethodGet , path + "?" + query , nil ); err != nil {
112
+ return nil , err
113
+ }
112
114
113
- err = c .Request (contactList , http .MethodGet , path + "?" + query , nil )
114
-
115
- return contactList , err
115
+ return contactList , nil
116
116
}
117
117
118
118
func listQuery (options * ListOptions ) (string , error ) {
@@ -135,7 +135,6 @@ func listQuery(options *ListOptions) (string, error) {
135
135
// Read retrieves the information of an existing contact.
136
136
func Read (c * messagebird.Client , id string ) (* Contact , error ) {
137
137
contact := & Contact {}
138
-
139
138
if err := c .Request (contact , http .MethodGet , path + "/" + id , nil ); err != nil {
140
139
return nil , err
141
140
}
@@ -147,7 +146,6 @@ func Read(c *messagebird.Client, id string) (*Contact, error) {
147
146
// Do not set any values that should not be updated.
148
147
func Update (c * messagebird.Client , id string , contactRequest * Request ) (* Contact , error ) {
149
148
contact := & Contact {}
150
-
151
149
if err := c .Request (contact , http .MethodPatch , path + "/" + id , contactRequest ); err != nil {
152
150
return nil , err
153
151
}
0 commit comments