From fed88c8485db0e95b93045677a5b037aa4f2be77 Mon Sep 17 00:00:00 2001 From: tniezg Date: Mon, 13 Sep 2021 16:06:49 +0200 Subject: [PATCH] Sort getAllProducts by -updated_at when using a taxonomy --- framework/spree/api/operations/get-all-products.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/spree/api/operations/get-all-products.ts b/framework/spree/api/operations/get-all-products.ts index ca6023dc3..40407cd40 100644 --- a/framework/spree/api/operations/get-all-products.ts +++ b/framework/spree/api/operations/get-all-products.ts @@ -49,7 +49,7 @@ export default function getAllProductsOperation({ const first = getAllProductsVariables.first const filter = !defaultProductsTaxonomyId ? {} - : { filter: { taxons: defaultProductsTaxonomyId } } + : { filter: { taxons: defaultProductsTaxonomyId }, sort: '-updated_at' } const variables: SpreeSdkVariables = { methodPath: 'products.list',