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:
co-authored by
Anders Gustafsson
parent
3d7a36afc4
commit
be5471f958
@@ -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}
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user