feat(medusa): Refactor undefined check into a single util (#2024)

This commit is contained in:
Adrien de Peretti
2022-08-10 17:45:48 +02:00
committed by GitHub
parent bd031ef7ad
commit c31290c911
37 changed files with 118 additions and 94 deletions
@@ -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
)