Add pagination to orders and products (#106)

* Add pagination to orders and products

* remove comment

Co-authored-by: Anders Gustafsson <anders@photowall.se>
This commit is contained in:
Niklas Fondberg
2022-02-16 16:20:35 +01:00
committed by GitHub
co-authored by Anders Gustafsson
parent 3d7a36afc4
commit be5471f958
7 changed files with 23 additions and 14 deletions
+2 -2
View File
@@ -68,11 +68,11 @@ async function getProductsResult(
checkAccess(['products.read'], auth);
const total = (<ProductAPI>dataSources.productApi).getProductsTotal(input);
const items = (<ProductAPI>dataSources.productApi).getProducts(input);
const offset = input.pagination?.offset ?? 0;
return {
pagination: {
limit: input.pagination.limit,
offset: 0, // TODO: this will be implemented later if the client app needs it
offset: offset,
total: total,
},
items: items,