fix(medusa): import and use RequestQueryFields from types package (#7275)

Noticed that `RequestQueryFields` is defined in both the `medusa` and `types` package. Within the `medusa` package sometimes it uses the local type definition or the definition in `types`.

This PR removes the type definition of `RequestQueryFields` in `medusa` and uses that in `types` instead.
This commit is contained in:
Shahed Nasser
2024-05-08 12:55:29 +00:00
committed by GitHub
parent 67944dcc92
commit c71a06c87f
6 changed files with 15 additions and 36 deletions
@@ -5,10 +5,11 @@ import {
} from "@medusajs/utils"
import { pick } from "lodash"
import { MedusaError, isDefined } from "medusa-core-utils"
import { RequestQueryFields } from "@medusajs/types"
import { BaseEntity } from "../interfaces"
import { featureFlagRouter } from "../loaders/feature-flags"
import MedusaV2 from "../loaders/feature-flags/medusa-v2"
import { FindConfig, QueryConfig, RequestQueryFields } from "../types/common"
import { FindConfig, QueryConfig } from "../types/common"
export function pickByConfig<TModel extends BaseEntity>(
obj: TModel | TModel[],
@@ -1,8 +1,9 @@
import { ValidatorOptions } from "class-validator"
import { NextFunction, Request, Response } from "express"
import { omit } from "lodash"
import { RequestQueryFields } from "@medusajs/types"
import { BaseEntity } from "../../interfaces"
import { FindConfig, QueryConfig, RequestQueryFields } from "../../types/common"
import { FindConfig, QueryConfig } from "../../types/common"
import { ClassConstructor } from "../../types/global"
import { removeUndefinedProperties } from "../../utils"
import {