Make sure payload is always passed, even if null

This commit is contained in:
snipe 2017-08-25 03:27:31 -07:00
parent d23ea70b08
commit 14c0c314aa

View file

@ -683,12 +683,11 @@ class Helper
public static function formatStandardApiResponse($status, $payload = null, $messages = null) {
$array['status'] = $status;
($payload) ? $array['payload'] = $payload : '';
$array['messages'] = $messages;
if (($messages) && (count($messages) > 0)) {
$array['messages'] = $messages;
}
($payload) ? $array['payload'] = $payload : $array['payload'] = null;
return $array;
}