fix(medusa, types): fix more query types (#8907)
Fix issues / missing query types I didn't pick up in the previous PRs.
This commit is contained in:
@@ -28,11 +28,20 @@ export const AdminGetOrdersParams = createFindParams({
|
||||
offset: 0,
|
||||
}).merge(
|
||||
z.object({
|
||||
id: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
status: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
id: z
|
||||
.union([z.string(), z.array(z.string()), createOperatorMap()])
|
||||
.optional(),
|
||||
status: z
|
||||
.union([z.string(), z.array(z.string()), createOperatorMap()])
|
||||
.optional(),
|
||||
name: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
sales_channel_id: z.array(z.string()).optional(),
|
||||
fulfillment_status: z.array(z.string()).optional(),
|
||||
payment_status: z.array(z.string()).optional(),
|
||||
region_id: z.array(z.string()).optional(),
|
||||
q: z.string().optional(),
|
||||
created_at: createOperatorMap().optional(),
|
||||
updated_at: createOperatorMap().optional(),
|
||||
deleted_at: createOperatorMap().optional(),
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
@@ -3,14 +3,13 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../types/routing"
|
||||
import { AdminGetPaymentProvidersParamsType } from "../validators"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetPaymentProvidersParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminPaymentProviderFilters>,
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentProviderListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from "../../helpers"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductVariantParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminProductVariantListResponse>
|
||||
) => {
|
||||
const productId = req.params.id
|
||||
|
||||
@@ -4,10 +4,9 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { getRuleAttributesMap, validateRuleType } from "../../utils"
|
||||
import { AdminGetPromotionRuleParamsType } from "../../validators"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetPromotionRuleParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetPromotionRuleParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminRuleAttributeOptionsListResponse>
|
||||
) => {
|
||||
const { rule_type: ruleType } = req.params
|
||||
|
||||
@@ -9,13 +9,9 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { refetchShippingProfile } from "./helpers"
|
||||
import {
|
||||
AdminCreateShippingProfileType,
|
||||
AdminGetShippingProfilesParamsType,
|
||||
} from "./validators"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateShippingProfileType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateShippingProfile>,
|
||||
res: MedusaResponse<HttpTypes.AdminShippingProfileResponse>
|
||||
) => {
|
||||
const shippingProfilePayload = req.validatedBody
|
||||
@@ -34,7 +30,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetShippingProfilesParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminShippingProfileListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminShippingProfileListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
Reference in New Issue
Block a user