Fixed #9085 - asset models not showing proper pagination

Huge thanks to @inietov for catching this one
This commit is contained in:
snipe 2021-02-25 16:43:38 -08:00
parent 57e52f0ba4
commit f37d5d3d03
2 changed files with 23 additions and 23 deletions

View file

@ -96,8 +96,9 @@ class AssetModelsController extends Controller
break;
}
$total = $assetmodels->count();
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $assetmodels->count());
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
}

View file

@ -55,24 +55,23 @@
@endif
<div class="table-responsive">
<table
data-side-pagination="server"
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
data-cookie-id-table="modelsTable"
data-cookie-id-table="asssetModelsTable"
data-pagination="true"
data-id-table="modelsTable"
data-id-table="asssetModelsTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-toolbar="#toolbar"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
data-page-size='30'
id="modelsTable"
data-url="{{ route('api.models.index', ['status'=> e(Request::get('status'))]) }}"
id="asssetModelsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.models.index') }}"
data-export-options='{
"fileName": "export-asset-models-{{ date('Y-m-d') }}",
"fileName": "export-models-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>