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:
1 parent
cff54d7325
commit
3d6bcaaf65
2 files changed
+6
-1
No files matched your search
@@ -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
|
* @return {Promise} the result of the find operation
|
||||||
*/
|
*/
|
||||||
async list(
|
async list(
|
||||||
selector: Selector<ShippingMethod>,
|
selector: Selector<ShippingOption>,
|
||||||
config: FindConfig<ShippingOption> = { skip: 0, take: 50 }
|
config: FindConfig<ShippingOption> = { skip: 0, take: 50 }
|
||||||
): Promise<ShippingOption[]> {
|
): Promise<ShippingOption[]> {
|
||||||
const optRepo = this.activeManager_.withRepository(this.optionRepository_)
|
const optRepo = this.activeManager_.withRepository(this.optionRepository_)
|
||||||
|
|||||||
Reference in new issue
Block a user