unify getData() response
This commit is contained in:
@ -13,7 +13,7 @@ class ErrorResponse extends Response {
|
|||||||
|
|
||||||
function getData() {
|
function getData() {
|
||||||
if(empty($this->errors)) {
|
if(empty($this->errors)) {
|
||||||
return false;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return array(
|
return array(
|
||||||
'errors' => $this->errors
|
'errors' => $this->errors
|
||||||
|
@ -6,7 +6,7 @@ if(!defined('ABSPATH')) exit;
|
|||||||
class SuccessResponse extends Response {
|
class SuccessResponse extends Response {
|
||||||
public $data;
|
public $data;
|
||||||
|
|
||||||
function __construct($data = null, $meta = null, $status = self::STATUS_OK) {
|
function __construct($data = array(), $meta = array(), $status = self::STATUS_OK) {
|
||||||
parent::__construct($status, $meta);
|
parent::__construct($status, $meta);
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user