fix(file): fixed index response with track_type and orderby

This commit is contained in:
Marco Cavalli 2025-03-04 17:14:49 +01:00
parent e5b136dec4
commit ae20567e41

View file

@ -20,14 +20,13 @@ class FileController extends Controller
* @return mixed
*/
public function index(FileFilters $filters) {
if (!isset($filters->per_page) || is_null($filters)) {
$pagination = 20;
$pagination = 5;
} else {
$pagination = $filters->per_page;
}
return File::searchFilter($filters)->cursorPaginate($pagination)->toJson();
return File::searchFilter($filters)->with('trackType')->orderBy('artist_name')->paginate($pagination);
}
/**