feat: Convert several batch methods to the standardized format (#7116)

This commit is contained in:
Stevche Radevski
2024-04-22 16:35:10 +02:00
committed by GitHub
parent 0eb68541b8
commit 0df523594f
63 changed files with 614 additions and 919 deletions
@@ -308,8 +308,8 @@ medusaIntegrationTestRunner({
it("should add sales channels to a location", async () => {
const salesChannelResponse = await api.post(
`/admin/stock-locations/${location.id}/sales-channels/batch/add?fields=*sales_channels`,
{ sales_channel_ids: [salesChannel.id] },
`/admin/stock-locations/${location.id}/sales-channels?fields=*sales_channels`,
{ add: [salesChannel.id] },
adminHeaders
)
@@ -356,16 +356,16 @@ medusaIntegrationTestRunner({
location = locationResponse.data.stock_location
await api.post(
`/admin/stock-locations/${location.id}/sales-channels/batch/add?fields=*sales_channels`,
{ sales_channel_ids: [salesChannel1.id, salesChannel2.id] },
`/admin/stock-locations/${location.id}/sales-channels?fields=*sales_channels`,
{ add: [salesChannel1.id, salesChannel2.id] },
adminHeaders
)
})
it("should remove sales channels from a location", async () => {
const salesChannelResponse = await api.post(
`/admin/stock-locations/${location.id}/sales-channels/batch/remove?fields=*sales_channels`,
{ sales_channel_ids: [salesChannel1.id] },
`/admin/stock-locations/${location.id}/sales-channels?fields=*sales_channels`,
{ remove: [salesChannel1.id] },
adminHeaders
)