feat(medusa): Refactor undefined check into a single util (#2024)
This commit is contained in:
@@ -5,6 +5,7 @@ import { CustomerService } from "../../services"
|
||||
import { FindConfig } from "../../types/common"
|
||||
import { validator } from "../../utils/validator"
|
||||
import { Customer } from "../../models/customer"
|
||||
import { isDefined } from "../../utils"
|
||||
|
||||
const listAndCount = async (
|
||||
scope,
|
||||
@@ -33,7 +34,7 @@ const listAndCount = async (
|
||||
])
|
||||
|
||||
const [customers, count] = await customerService.listAndCount(
|
||||
pickBy(filterableFields, (val) => typeof val !== "undefined"),
|
||||
pickBy(filterableFields, (val) => isDefined(val)),
|
||||
listConfig
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user