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 -1
View File
@@ -77,6 +77,7 @@ FROM "product-products" products
export function products(input: ProductsFilterInput) {
const limit = input.pagination.limit ?? 100;
const offset = input.pagination.offset ?? 0;
const filter = input.filter ?? null;
return (
baseQuery +
@@ -89,7 +90,7 @@ export function products(input: ProductsFilterInput) {
: ``
}
ORDER BY products.inserted DESC
LIMIT ${limit}
LIMIT ${limit} OFFSET ${offset}
`
);
}