fix(types, medusa): http types fixes (#9334)
* fix(types, medusa): http types fixes * fix build error * remove return fields * more fixes * fix cart payload types
This commit is contained in:
+1
-2
@@ -5,10 +5,9 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../../types/routing"
|
||||
import { refetchEntity } from "../../../../../../utils/refetch-entity"
|
||||
import { AdminMarkOrderFulfillmentDeliveredType } from "../../../../validators"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminMarkOrderFulfillmentDeliveredType>,
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const { id: orderId, fulfillment_id: fulfillmentId } = req.params
|
||||
|
||||
@@ -7,7 +7,7 @@ import { remapKeysForProduct } from "../helpers"
|
||||
import { exportProductsWorkflow } from "@medusajs/core-flows"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminExportProductRequest>,
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse<HttpTypes.AdminExportProductResponse>
|
||||
) => {
|
||||
const selectFields = remapKeysForProduct(req.remoteQueryConfig.fields ?? [])
|
||||
|
||||
@@ -4,18 +4,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { BatchMethodRequest, HttpTypes } from "@medusajs/framework/types"
|
||||
import {
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType,
|
||||
} from "../../../validators"
|
||||
import { RuleType } from "@medusajs/framework/utils"
|
||||
import { refetchBatchRules } from "../../../helpers"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
BatchMethodRequest<
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType
|
||||
HttpTypes.AdminCreatePromotionRule,
|
||||
HttpTypes.AdminUpdatePromotionRule
|
||||
>
|
||||
>,
|
||||
res: MedusaResponse<HttpTypes.AdminPromotionRuleBatchResponse>
|
||||
|
||||
@@ -4,18 +4,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { BatchMethodRequest, HttpTypes } from "@medusajs/framework/types"
|
||||
import {
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType,
|
||||
} from "../../../validators"
|
||||
import { RuleType } from "@medusajs/framework/utils"
|
||||
import { refetchBatchRules } from "../../../helpers"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
BatchMethodRequest<
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType
|
||||
HttpTypes.AdminCreatePromotionRule,
|
||||
HttpTypes.AdminUpdatePromotionRule
|
||||
>
|
||||
>,
|
||||
res: MedusaResponse<HttpTypes.AdminPromotionRuleBatchResponse>
|
||||
|
||||
@@ -4,18 +4,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { BatchMethodRequest, HttpTypes } from "@medusajs/framework/types"
|
||||
import {
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType,
|
||||
} from "../../../validators"
|
||||
import { RuleType } from "@medusajs/framework/utils"
|
||||
import { refetchBatchRules } from "../../../helpers"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
BatchMethodRequest<
|
||||
AdminCreatePromotionRuleType,
|
||||
AdminUpdatePromotionRuleType
|
||||
HttpTypes.AdminCreatePromotionRule,
|
||||
HttpTypes.AdminUpdatePromotionRule
|
||||
>
|
||||
>,
|
||||
res: MedusaResponse<HttpTypes.AdminPromotionRuleBatchResponse>
|
||||
|
||||
@@ -3,18 +3,14 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../types/routing"
|
||||
import { BatchMethodRequest, HttpTypes } from "@medusajs/framework/types"
|
||||
import {
|
||||
AdminCreateShippingOptionRuleType,
|
||||
AdminUpdateShippingOptionRuleType,
|
||||
} from "../../../validators"
|
||||
import { refetchBatchRules } from "../../../helpers"
|
||||
import { batchShippingOptionRulesWorkflow } from "@medusajs/core-flows"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
BatchMethodRequest<
|
||||
AdminCreateShippingOptionRuleType,
|
||||
AdminUpdateShippingOptionRuleType
|
||||
HttpTypes.AdminCreateShippingOptionRule,
|
||||
HttpTypes.AdminUpdateShippingOptionRule
|
||||
>
|
||||
>,
|
||||
res: MedusaResponse<HttpTypes.AdminUpdateShippingOptionRulesResponse>
|
||||
|
||||
@@ -7,7 +7,6 @@ const defaultStoreCustomersFields = [
|
||||
"phone",
|
||||
"metadata",
|
||||
"has_account",
|
||||
"created_by",
|
||||
"deleted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
export const defaultStoreOrderFields = [
|
||||
"id",
|
||||
"status",
|
||||
"version",
|
||||
"summary",
|
||||
"display_id",
|
||||
"total",
|
||||
@@ -16,7 +15,6 @@ export const defaultStoreOrderFields = [
|
||||
export const defaultStoreRetrieveOrderFields = [
|
||||
"id",
|
||||
"status",
|
||||
"version",
|
||||
"summary",
|
||||
"currency_code",
|
||||
"display_id",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod"
|
||||
import {
|
||||
GetProductsParams,
|
||||
ProductStatusEnum,
|
||||
transformProductParams,
|
||||
} from "../../utils/common-validators"
|
||||
import {
|
||||
@@ -32,7 +31,6 @@ export const StoreGetProductVariantsParams = createFindParams({
|
||||
z.object({
|
||||
q: z.string().optional(),
|
||||
id: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
status: ProductStatusEnum.array().optional(),
|
||||
options: z.object({ value: z.string(), option_id: z.string() }).optional(),
|
||||
created_at: createOperatorMap().optional(),
|
||||
updated_at: createOperatorMap().optional(),
|
||||
@@ -58,7 +56,6 @@ export const StoreGetProductsParams = createFindParams({
|
||||
|
||||
variants: z
|
||||
.object({
|
||||
status: ProductStatusEnum.array().optional(),
|
||||
options: z
|
||||
.object({ value: z.string(), option_id: z.string() })
|
||||
.optional(),
|
||||
|
||||
Reference in New Issue
Block a user