feat(medusa): Ordering products on retrieval (#2815)

**What**

Move to transformQuery which adds a default ordering and also allows to order the product list from the store API

**How**
Among other things, fix the product repo to allow ordering by either a key from the product or a key from a relation

FIXES CORE-911
FIXES CORE-901
This commit is contained in:
Adrien de Peretti
2022-12-22 11:33:53 +01:00
committed by GitHub
parent 5ae319004f
commit 463f83ffdd
17 changed files with 1080 additions and 1927 deletions

View File

@@ -647,10 +647,10 @@ describe("[MEDUSA_FF_PUBLISHABLE_API_KEYS] Publishable API keys", () => {
expect(response.data.products).toEqual(
expect.arrayContaining([
expect.objectContaining({
id: product1.id,
id: product2.id,
}),
expect.objectContaining({
id: product2.id,
id: product1.id,
}),
])
)