Skip to content

Commit 148143a

Browse files
committed
retrun response object (better to pagination need Total and Count)
1 parent 92aecc4 commit 148143a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ High level API methods:
119119

120120
For more informations about the filters you can use in each methods, refer to the [Mailjet API documentation](https://dev.mailjet.com/email-api/v3/apikey/)
121121

122-
All method return the data array or throw a MailjetException in case of API error.
122+
All method return Mailjet\Response or throw a MailjetException in case of API error.
123123

124124
You can also get the client with the method `getClient()` and make your own request to Mailjet API.
125125

src/Services/MailjetService.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function post($resource, array $args = [], array $options = [])
3838
if (!$response->success()) {
3939
$this->throwError("MailjetService:post() failed", $response);
4040
}
41-
return $response->getData();
41+
return $response;
4242
}
4343

4444
/**
@@ -56,7 +56,7 @@ public function get($resource, array $args = [], array $options = [])
5656
if (!$response->success()) {
5757
$this->throwError("MailjetService:get() failed", $response);
5858
}
59-
return $response->getData();
59+
return $response;
6060
}
6161

6262
/**
@@ -74,7 +74,7 @@ public function put($resource, array $args = [], array $options = [])
7474
if (!$response->success()) {
7575
$this->throwError("MailjetService:put() failed", $response);
7676
}
77-
return $response->getData();
77+
return $response;
7878
}
7979

8080
/**
@@ -92,7 +92,7 @@ public function delete($resource, array $args = [], array $options = [])
9292
if (!$response->success()) {
9393
$this->throwError("MailjetService:delete() failed", $response);
9494
}
95-
return $response->getData();
95+
return $response;
9696
}
9797

9898
/**
@@ -106,7 +106,7 @@ public function getAllLists($filters)
106106
if (!$response->success()) {
107107
$this->throwError("MailjetService:getAllLists() failed", $response);
108108
}
109-
return $response->getData();
109+
return $response;
110110
}
111111

112112
/**
@@ -120,7 +120,7 @@ public function createList($body)
120120
if (!$response->success()) {
121121
$this->throwError("MailjetService:createList() failed", $response);
122122
}
123-
return $response->getData();
123+
return $response;
124124
}
125125

126126
/**
@@ -134,7 +134,7 @@ public function getListRecipients($filters)
134134
if (!$response->success()) {
135135
$this->throwError("MailjetService:getListRecipients() failed", $response);
136136
}
137-
return $response->getData();
137+
return $response;
138138
}
139139

140140
/**
@@ -148,7 +148,7 @@ public function getSingleContact($id)
148148
if (!$response->success()) {
149149
$this->throwError("MailjetService:getSingleContact() failed", $response);
150150
}
151-
return $response->getData();
151+
return $response;
152152
}
153153

154154
/**
@@ -162,7 +162,7 @@ public function createContact($body)
162162
if (!$response->success()) {
163163
$this->throwError("MailjetService:createContact() failed", $response);
164164
}
165-
return $response->getData();
165+
return $response;
166166
}
167167

168168
/**
@@ -176,7 +176,7 @@ public function createListRecipient($body)
176176
if (!$response->success()) {
177177
$this->throwError("MailjetService:createListRecipient() failed", $response);
178178
}
179-
return $response->getData();
179+
return $response;
180180
}
181181

182182
/**
@@ -191,7 +191,7 @@ public function editListrecipient($id, $body)
191191
if (!$response->success()) {
192192
$this->throwError("MailjetService:editListrecipient() failed", $response);
193193
}
194-
return $response->getData();
194+
return $response;
195195
}
196196

197197
/**

0 commit comments

Comments
 (0)