feat(medusa): Middleware to add default SC on query if no SC already exist on it (#3694)

This commit is contained in:
Rares Stefan
2023-04-26 17:23:29 +02:00
committed by GitHub
parent d97a6f3321
commit 3a77e8a88f
7 changed files with 107 additions and 35 deletions

View File

@@ -682,7 +682,7 @@ describe("Publishable API keys", () => {
)
})
it("returns all products if PK is not passed", async () => {
it("returns default product from default sales channel if PK is not passed", async () => {
const api = useApi()
await api.post(
@@ -703,15 +703,9 @@ describe("Publishable API keys", () => {
},
})
expect(response.data.products.length).toBe(3)
expect(response.data.products.length).toBe(1)
expect(response.data.products).toEqual(
expect.arrayContaining([
expect.objectContaining({
id: product1.id,
}),
expect.objectContaining({
id: product2.id,
}),
expect.objectContaining({
id: product3.id,
}),