File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,12 @@ public function format($response)
39
39
if ($ this ->prettyPrint ) {
40
40
$ options |= JSON_PRETTY_PRINT ;
41
41
}
42
-
42
+ $ apiDocument = $ response -> data ;
43
43
if ($ response ->isClientError || $ response ->isServerError ) {
44
44
if (ArrayHelper::isAssociative ($ response ->data )) {
45
45
$ response ->data = [$ response ->data ];
46
46
}
47
47
$ apiDocument = ['errors ' => $ response ->data ];
48
- } elseif (ArrayHelper::keyExists ('data ' , $ response ->data )) {
49
- $ apiDocument = $ response ->data ;
50
- } else {
51
- $ apiDocument = ['meta ' => $ response ->data ];
52
48
}
53
49
54
50
$ response ->content = Json::encode ($ apiDocument , $ options );
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * @link http://www.stombox.com/
4
- * @copyright Copyright (c) 2015 Stombox LLC
5
- * @license http://www.stombox.com/license/
3
+ * @author Anton Tuyakhov <atuyakhov@gmail.com>
6
4
*/
7
5
8
6
namespace tuyakhov \jsonapi ;
You can’t perform that action at this time.
0 commit comments