fix: add order to pagination types (#9471)

This commit is contained in:
Carlos R. L. Rodrigues
2024-10-04 12:57:44 +00:00
committed by GitHub
parent f7472a6fa6
commit d06ea6985d
2 changed files with 4 additions and 0 deletions
@@ -4,6 +4,7 @@ import {
RemoteQueryGraph, RemoteQueryGraph,
RemoteQueryObjectConfig, RemoteQueryObjectConfig,
} from "@medusajs/types" } from "@medusajs/types"
import { IndexOrderBy } from "@medusajs/types/dist/index/query-config/query-input-config-order-by"
import { QueryContext, QueryFilter, isObject } from "@medusajs/utils" import { QueryContext, QueryFilter, isObject } from "@medusajs/utils"
import { parseAndAssignFilters } from "./parse-filters" import { parseAndAssignFilters } from "./parse-filters"
@@ -36,6 +37,7 @@ export function toRemoteQuery<const TEntity extends string>(
pagination?: { pagination?: {
skip?: number skip?: number
take?: number take?: number
order?: IndexOrderBy<TEntity>
} }
context?: Record<string, any> context?: Record<string, any>
}, },
@@ -1,3 +1,4 @@
import { IndexOrderBy } from "../index/query-config/query-input-config-order-by"
import { ObjectToRemoteQueryFields } from "./object-to-remote-query-fields" import { ObjectToRemoteQueryFields } from "./object-to-remote-query-fields"
import { RemoteQueryEntryPoints } from "./remote-query-entry-points" import { RemoteQueryEntryPoints } from "./remote-query-entry-points"
import { RemoteQueryFilters } from "./to-remote-query" import { RemoteQueryFilters } from "./to-remote-query"
@@ -35,6 +36,7 @@ export type RemoteQueryInput<TEntry extends string> = {
pagination?: { pagination?: {
skip: number skip: number
take?: number take?: number
order?: IndexOrderBy<TEntry>
} }
filters?: RemoteQueryFilters<TEntry> filters?: RemoteQueryFilters<TEntry>
context?: any context?: any