feat(medusa): ordem items endpoint (#9646)
This commit is contained in:
committed by
GitHub
parent
0a37675f0e
commit
2a98be6b65
@@ -116,7 +116,7 @@ export interface MedusaRequest<Body = unknown>
|
||||
*/
|
||||
remoteQueryConfig: {
|
||||
fields: string[]
|
||||
pagination: { order?: Record<string, string>; skip?: number; take?: number }
|
||||
pagination: { order?: Record<string, string>; skip: number; take?: number }
|
||||
}
|
||||
/**
|
||||
* An object containing the fields that are filterable e.g `{ id: Any<String> }`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MedusaContainer } from "@medusajs/types"
|
||||
import {
|
||||
isString,
|
||||
ContainerRegistrationKeys,
|
||||
isString,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { MedusaRequest } from "../types"
|
||||
@@ -11,7 +11,7 @@ export const refetchEntities = async (
|
||||
idOrFilter: string | object,
|
||||
scope: MedusaContainer,
|
||||
fields: string[],
|
||||
pagination: MedusaRequest["remoteQueryConfig"]["pagination"] = {}
|
||||
pagination?: MedusaRequest["remoteQueryConfig"]["pagination"]
|
||||
) => {
|
||||
const remoteQuery = scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const filters = isString(idOrFilter) ? { id: idOrFilter } : idOrFilter
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { z } from "zod"
|
||||
import { omit } from "lodash"
|
||||
import { NextFunction } from "express"
|
||||
import { MedusaError, removeUndefinedProperties } from "@medusajs/utils"
|
||||
import { BaseEntity, QueryConfig, RequestQueryFields } from "@medusajs/types"
|
||||
import { MedusaError, removeUndefinedProperties } from "@medusajs/utils"
|
||||
import { NextFunction } from "express"
|
||||
import { omit } from "lodash"
|
||||
import { z } from "zod"
|
||||
|
||||
import { zodValidator } from "../../zod/zod-helpers"
|
||||
import { MedusaRequest, MedusaResponse } from "../types"
|
||||
@@ -79,7 +79,7 @@ export function validateAndTransformQuery<TEntity extends BaseEntity>(
|
||||
|
||||
req.validatedQuery = validated
|
||||
req.filterableFields = getFilterableFields(req.validatedQuery)
|
||||
req.remoteQueryConfig = cnf.remoteQueryConfig
|
||||
req.remoteQueryConfig = cnf.remoteQueryConfig as any
|
||||
req.listConfig = (cnf as any).listConfig
|
||||
req.retrieveConfig = (cnf as any).retrieveConfig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user