diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php index d4826ce2d..45503a2c4 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php @@ -22,7 +22,7 @@ class postsController extends Controller } public function index(){ - $path = Config::get('app.cdn'); + $path = Config::get('app.cdn').Config::get('cms.storage.media.path'); $data = $this->Post::with(['categories:id,name'])->listFrontEnd([ 'page' => input('page'), 'sort' => input('sort')??'published_at desc', @@ -38,7 +38,7 @@ class postsController extends Controller public function show($locale,$id){ - $data = $this->Post::with('categories')->find($id); + $data = $this->Post::with('views')->find($id); if ($data){ return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);