fix(medusa-js): remove unnecessary query field in AdminInventoryItemsResource.deleteLocationLevel method (#5941)

## What

The underlying endpoint `/admin/inventory-items/{id}/location-levels/{location_id}` that the JS Client's `AdminInventoryItemsResource.deleteLocationLevel` method sends a request to doesn't accept query parameters. So, the `query` argument of the `deleteLocationLevel` is unnecessary.

Fixes CORE-1550
This commit is contained in:
Shahed Nasser
2023-12-21 16:38:53 +02:00
committed by GitHub
parent 8402f46970
commit bfd10dadaf
2 changed files with 6 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa-js": patch
---
fix(medusa-js): remove unnecessary `query` field in `AdminInventoryItemsResource.deleteLocationLevel` method

View File

@@ -289,7 +289,6 @@ class AdminInventoryItemsResource extends BaseResource {
* Delete a location level of an Inventory Item.
* @param {string} inventoryItemId - The ID of the inventory item.
* @param {string} locationId - The ID of the location level to delete.
* @param {AdminGetInventoryItemsParams} query - Configurations to apply on the returned inventory item.
* @param {Record<string, any>} customHeaders - Custom headers to attach to the request.
* @returns {ResponsePromise<AdminInventoryItemsRes>} the inventory item's details.
*
@@ -305,15 +304,9 @@ class AdminInventoryItemsResource extends BaseResource {
deleteLocationLevel(
inventoryItemId: string,
locationId: string,
query?: AdminGetInventoryItemsParams,
customHeaders: Record<string, any> = {}
): ResponsePromise<AdminInventoryItemsRes> {
let path = `/admin/inventory-items/${inventoryItemId}/location-levels/${locationId}`
if (query) {
const queryString = qs.stringify(query)
path += `?${queryString}`
}
const path = `/admin/inventory-items/${inventoryItemId}/location-levels/${locationId}`
return this.client.request("DELETE", path, undefined, {}, customHeaders)
}