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:
5
.changeset/eighty-mails-behave.md
Normal file
5
.changeset/eighty-mails-behave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa-js": patch
|
||||
---
|
||||
|
||||
fix(medusa-js): remove unnecessary `query` field in `AdminInventoryItemsResource.deleteLocationLevel` method
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user