fix(medusa): ShippingOptionService.list method param type (#4018)
## What
Fix typing on ShippingOptionService.list selector parameter
## Why
A backend server interfacing with the `ShippingOptionService.list()` method will throw TS error when attempting to pass selector values that should be valid.
## Steps to reproduce
* In a IDE that can display TS errors
* Create an instance of the ShippingOptionService
* Call the `list()` method on the instance with the following selector parameter: `{ region_id: "foobar" }`
* Expect: No TS error
* Actual: `TS2345: Argument of type '{ region_id: string; }' is not assignable to parameter of type 'Selector<ShippingMethod>'.`
## How
* Change the `selector` type to `Selector<ShippingOption>`
This commit is contained in:
5
.changeset/good-beans-know.md
Normal file
5
.changeset/good-beans-know.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): ShippingOptionService.list method param type
|
||||
@@ -143,7 +143,7 @@ class ShippingOptionService extends TransactionBaseService {
|
||||
* @return {Promise} the result of the find operation
|
||||
*/
|
||||
async list(
|
||||
selector: Selector<ShippingMethod>,
|
||||
selector: Selector<ShippingOption>,
|
||||
config: FindConfig<ShippingOption> = { skip: 0, take: 50 }
|
||||
): Promise<ShippingOption[]> {
|
||||
const optRepo = this.activeManager_.withRepository(this.optionRepository_)
|
||||
|
||||
Reference in New Issue
Block a user