feat: Add batch method to collection and clean up some batch implementations (#7102)
This commit is contained in:
@@ -334,7 +334,7 @@ medusaIntegrationTestRunner({
|
||||
|
||||
it("should delete an inventory location level and create a new one", async () => {
|
||||
const result = await api.post(
|
||||
`/admin/inventory-items/${inventoryItem.id}/location-levels/op/batch`,
|
||||
`/admin/inventory-items/${inventoryItem.id}/location-levels/batch`,
|
||||
{
|
||||
create: [
|
||||
{
|
||||
|
||||
@@ -618,23 +618,21 @@ medusaIntegrationTestRunner({
|
||||
{ relations: ["prices"] }
|
||||
)
|
||||
|
||||
const data = { product_id: [product.id] }
|
||||
const data = { remove: [product.id] }
|
||||
const response = await api.post(
|
||||
`admin/price-lists/${priceList.id}/prices/batch`,
|
||||
`admin/price-lists/${priceList.id}/products`,
|
||||
data,
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data).toEqual({
|
||||
created: [],
|
||||
updated: [],
|
||||
deleted: {
|
||||
ids: ["price-to-delete-1", "price-to-delete-2"],
|
||||
object: "price",
|
||||
deleted: true,
|
||||
},
|
||||
})
|
||||
expect(response.data.price_list).toEqual(
|
||||
expect.objectContaining({
|
||||
id: expect.any(String),
|
||||
title: "test price list",
|
||||
description: "test",
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user