chore(types, medusa): [2/n] add missing query type arguments (#8879)
Add missing type arguments in listing requests. 2/n
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { BaseFilterable } from "../../../dal"
|
import { BaseFilterable, OperatorMap } from "../../../dal"
|
||||||
import { FindParams } from "../../common"
|
import { FindParams } from "../../common"
|
||||||
import {
|
import {
|
||||||
BasePaymentCollectionFilters,
|
BasePaymentCollectionFilters,
|
||||||
@@ -16,13 +16,17 @@ export interface AdminPaymentCollectionFilters
|
|||||||
extends BasePaymentCollectionFilters {}
|
extends BasePaymentCollectionFilters {}
|
||||||
export interface AdminPaymentSessionFilters extends BasePaymentSessionFilters {}
|
export interface AdminPaymentSessionFilters extends BasePaymentSessionFilters {}
|
||||||
|
|
||||||
export interface AdminPaymentFilters extends BasePaymentFilters {}
|
export interface AdminPaymentFilters extends FindParams, BasePaymentFilters {
|
||||||
|
q?: string
|
||||||
export interface RefundFilters extends BaseFilterable<AdminRefund> {
|
payment_session_id?: string | string[]
|
||||||
id?: string | string[]
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
}
|
}
|
||||||
export interface RefundReasonFilters extends BaseFilterable<AdminRefundReason> {
|
|
||||||
|
export interface RefundReasonFilters extends FindParams, BaseFilterable<AdminRefundReason> {
|
||||||
id?: string | string[]
|
id?: string | string[]
|
||||||
|
q?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminGetPaymentProvidersParams
|
export interface AdminGetPaymentProvidersParams
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface AdminPricePreferenceListParams
|
|||||||
id?: string | string[]
|
id?: string | string[]
|
||||||
attribute?: string | string[]
|
attribute?: string | string[]
|
||||||
value?: string | string[]
|
value?: string | string[]
|
||||||
|
q?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminPricePreferenceParams extends SelectParams {}
|
export interface AdminPricePreferenceParams extends SelectParams {}
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../../dal"
|
||||||
|
import { FindParams } from "../../common"
|
||||||
import {
|
import {
|
||||||
BaseProductListParams,
|
BaseProductListParams,
|
||||||
BaseProductOptionParams,
|
BaseProductOptionParams,
|
||||||
BaseProductVariantParams,
|
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface AdminProductOptionParams extends BaseProductOptionParams {}
|
export interface AdminProductOptionParams extends BaseProductOptionParams {}
|
||||||
export interface AdminProductVariantParams extends BaseProductVariantParams {}
|
export interface AdminProductVariantParams extends
|
||||||
|
FindParams, BaseFilterable<AdminProductVariantParams> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
manage_inventory?: boolean
|
||||||
|
allow_backorder?: boolean
|
||||||
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
export interface AdminProductListParams extends BaseProductListParams {
|
export interface AdminProductListParams extends BaseProductListParams {
|
||||||
price_list_id?: string | string[]
|
price_list_id?: string | string[]
|
||||||
variants?: AdminProductVariantParams
|
variants?: AdminProductVariantParams
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../../dal";
|
||||||
|
import { FindParams } from "../../common";
|
||||||
import {
|
import {
|
||||||
BaseRegionCountryFilters,
|
BaseRegionCountryFilters,
|
||||||
BaseRegionFilters,
|
BaseRegionFilters,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface AdminRegionFilters extends BaseRegionFilters {}
|
export interface AdminRegionFilters extends FindParams, BaseFilterable<BaseRegionFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
code?: string | string[]
|
||||||
|
name?: string | string[]
|
||||||
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
export interface AdminRegionCountryFilters extends BaseRegionCountryFilters {}
|
export interface AdminRegionCountryFilters extends BaseRegionCountryFilters {}
|
||||||
@@ -4,11 +4,11 @@ import { FindParams } from "../../common"
|
|||||||
export interface AdminShippingOptionListParams extends FindParams {
|
export interface AdminShippingOptionListParams extends FindParams {
|
||||||
id?: string | string[]
|
id?: string | string[]
|
||||||
q?: string
|
q?: string
|
||||||
service_zone_id?: string
|
service_zone_id?: string | string[]
|
||||||
stock_location_id?: string | string[]
|
stock_location_id?: string | string[]
|
||||||
shipping_profile_id?: string
|
shipping_profile_id?: string | string[]
|
||||||
provider_id?: string
|
provider_id?: string | string[]
|
||||||
shipping_option_type_id?: string
|
shipping_option_type_id?: string | string[]
|
||||||
created_at?: OperatorMap<string>
|
created_at?: OperatorMap<string>
|
||||||
updated_at?: OperatorMap<string>
|
updated_at?: OperatorMap<string>
|
||||||
deleted_at?: OperatorMap<string>
|
deleted_at?: OperatorMap<string>
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { AdminGetPaymentsParamsType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetPaymentsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminPaymentFilters>,
|
||||||
res: MedusaResponse<HttpTypes.AdminPaymentsResponse>
|
res: MedusaResponse<HttpTypes.AdminPaymentsResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { AdminCreatePriceListType } from "./validators"
|
|||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminPriceListListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminPriceListListResponse>
|
res: MedusaResponse<HttpTypes.AdminPriceListListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { refetchEntities, refetchEntity } from "../../utils/refetch-entity"
|
|||||||
import { createPricePreferencesWorkflow } from "@medusajs/core-flows"
|
import { createPricePreferencesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminPricePreferenceListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminPricePreferenceListResponse>
|
res: MedusaResponse<HttpTypes.AdminPricePreferenceListResponse>
|
||||||
) => {
|
) => {
|
||||||
const { rows: price_preferences, metadata } = await refetchEntities(
|
const { rows: price_preferences, metadata } = await refetchEntities(
|
||||||
|
|||||||
@@ -1,21 +1,14 @@
|
|||||||
import { createProductCategoriesWorkflow } from "@medusajs/core-flows"
|
import { createProductCategoriesWorkflow } from "@medusajs/core-flows"
|
||||||
import {
|
import { HttpTypes } from "@medusajs/types"
|
||||||
AdminProductCategoryListResponse,
|
|
||||||
AdminProductCategoryResponse,
|
|
||||||
} from "@medusajs/types"
|
|
||||||
import {
|
import {
|
||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { refetchEntities } from "../../utils/refetch-entity"
|
import { refetchEntities } from "../../utils/refetch-entity"
|
||||||
import {
|
|
||||||
AdminCreateProductCategoryType,
|
|
||||||
AdminProductCategoriesParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminProductCategoriesParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductCategoryListParams>,
|
||||||
res: MedusaResponse<AdminProductCategoryListResponse>
|
res: MedusaResponse<HttpTypes.AdminProductCategoryListResponse>
|
||||||
) => {
|
) => {
|
||||||
const { rows: product_categories, metadata } = await refetchEntities(
|
const { rows: product_categories, metadata } = await refetchEntities(
|
||||||
"product_category",
|
"product_category",
|
||||||
@@ -34,8 +27,8 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateProductCategoryType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateProductCategory>,
|
||||||
res: MedusaResponse<AdminProductCategoryResponse>
|
res: MedusaResponse<HttpTypes.AdminProductCategoryResponse>
|
||||||
) => {
|
) => {
|
||||||
const { result } = await createProductCategoriesWorkflow(req.scope).run({
|
const { result } = await createProductCategoriesWorkflow(req.scope).run({
|
||||||
input: { product_categories: [req.validatedBody] },
|
input: { product_categories: [req.validatedBody] },
|
||||||
|
|||||||
@@ -4,15 +4,11 @@ import {
|
|||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
|
|
||||||
import { createProductTagsWorkflow } from "@medusajs/core-flows"
|
import { createProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
import {
|
|
||||||
AdminCreateProductTagType,
|
|
||||||
AdminGetProductTagsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { refetchEntities, refetchEntity } from "../../utils/refetch-entity"
|
import { refetchEntities, refetchEntity } from "../../utils/refetch-entity"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetProductTagsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductTagListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminProductTagListResponse>
|
res: MedusaResponse<HttpTypes.AdminProductTagListResponse>
|
||||||
) => {
|
) => {
|
||||||
const { rows: product_tags, metadata } = await refetchEntities(
|
const { rows: product_tags, metadata } = await refetchEntities(
|
||||||
@@ -32,7 +28,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateProductTagType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateProductTag>,
|
||||||
res: MedusaResponse<HttpTypes.AdminProductTagResponse>
|
res: MedusaResponse<HttpTypes.AdminProductTagResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = [req.validatedBody]
|
const input = [req.validatedBody]
|
||||||
|
|||||||
@@ -9,14 +9,10 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { createProductTypesWorkflow } from "@medusajs/core-flows"
|
import { createProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
import { refetchProductType } from "./helpers"
|
import { refetchProductType } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreateProductTypeType,
|
|
||||||
AdminGetProductTypesParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetProductTypesParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductTypeListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminProductTypeListResponse>
|
res: MedusaResponse<HttpTypes.AdminProductTypeListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -40,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateProductTypeType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateProductType>,
|
||||||
res: MedusaResponse<HttpTypes.AdminProductTypeResponse>
|
res: MedusaResponse<HttpTypes.AdminProductTypeResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = [req.validatedBody]
|
const input = [req.validatedBody]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { refetchEntities } from "../../utils/refetch-entity"
|
|||||||
import { remapKeysForVariant, remapVariantResponse } from "../products/helpers"
|
import { remapKeysForVariant, remapVariantResponse } from "../products/helpers"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductVariantParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminProductVariantListResponse>
|
res: MedusaResponse<HttpTypes.AdminProductVariantListResponse>
|
||||||
) => {
|
) => {
|
||||||
const withInventoryQuantity = req.remoteQueryConfig.fields.some((field) =>
|
const withInventoryQuantity = req.remoteQueryConfig.fields.some((field) =>
|
||||||
|
|||||||
@@ -8,14 +8,10 @@ import {
|
|||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { refetchPromotion } from "./helpers"
|
import { refetchPromotion } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreatePromotionType,
|
|
||||||
AdminGetPromotionsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetPromotionsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetPromotionsParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminPromotionListResponse>
|
res: MedusaResponse<HttpTypes.AdminPromotionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -40,7 +36,9 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreatePromotionType & AdditionalData>,
|
req: AuthenticatedMedusaRequest<
|
||||||
|
HttpTypes.AdminCreatePromotion & AdditionalData
|
||||||
|
>,
|
||||||
res: MedusaResponse<HttpTypes.AdminPromotionResponse>
|
res: MedusaResponse<HttpTypes.AdminPromotionResponse>
|
||||||
) => {
|
) => {
|
||||||
const { additional_data, ...rest } = req.validatedBody
|
const { additional_data, ...rest } = req.validatedBody
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import { createRefundReasonsWorkflow } from "@medusajs/core-flows"
|
import { createRefundReasonsWorkflow } from "@medusajs/core-flows"
|
||||||
import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework"
|
import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework"
|
||||||
import {
|
import {
|
||||||
|
AdminCreateRefundReason,
|
||||||
|
HttpTypes,
|
||||||
PaginatedResponse,
|
PaginatedResponse,
|
||||||
RefundReasonResponse,
|
RefundReasonResponse,
|
||||||
RefundReasonsResponse,
|
RefundReasonsResponse,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { refetchEntities, refetchEntity } from "../../utils/refetch-entity"
|
import { refetchEntities, refetchEntity } from "../../utils/refetch-entity"
|
||||||
import { AdminCreatePaymentRefundReasonType } from "./validators"
|
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.RefundReasonFilters>,
|
||||||
res: MedusaResponse<PaginatedResponse<RefundReasonsResponse>>
|
res: MedusaResponse<PaginatedResponse<RefundReasonsResponse>>
|
||||||
) => {
|
) => {
|
||||||
const { rows: refund_reasons, metadata } = await refetchEntities(
|
const { rows: refund_reasons, metadata } = await refetchEntities(
|
||||||
@@ -29,7 +30,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreatePaymentRefundReasonType>,
|
req: AuthenticatedMedusaRequest<AdminCreateRefundReason>,
|
||||||
res: MedusaResponse<RefundReasonResponse>
|
res: MedusaResponse<RefundReasonResponse>
|
||||||
) => {
|
) => {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -7,12 +7,11 @@ import {
|
|||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { AdminCreateRegionType, AdminGetRegionsParamsType } from "./validators"
|
|
||||||
import { refetchRegion } from "./helpers"
|
import { refetchRegion } from "./helpers"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetRegionsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminRegionFilters>,
|
||||||
res: MedusaResponse<HttpTypes.AdminRegionListResponse>
|
res: MedusaResponse<HttpTypes.AdminRegionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -37,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateRegionType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateRegion>,
|
||||||
res: MedusaResponse<HttpTypes.AdminRegionResponse>
|
res: MedusaResponse<HttpTypes.AdminRegionResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = [req.validatedBody]
|
const input = [req.validatedBody]
|
||||||
|
|||||||
@@ -8,15 +8,11 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
|
|
||||||
import { createReservationsWorkflow } from "@medusajs/core-flows"
|
import { createReservationsWorkflow } from "@medusajs/core-flows"
|
||||||
import {
|
|
||||||
AdminCreateReservationType,
|
|
||||||
AdminGetReservationsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { refetchReservation } from "./helpers"
|
import { refetchReservation } from "./helpers"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetReservationsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetReservationsParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminReservationListResponse>
|
res: MedusaResponse<HttpTypes.AdminReservationListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -41,7 +37,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateReservationType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateReservation>,
|
||||||
res: MedusaResponse<HttpTypes.AdminReservationResponse>
|
res: MedusaResponse<HttpTypes.AdminReservationResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = [req.validatedBody]
|
const input = [req.validatedBody]
|
||||||
|
|||||||
@@ -8,10 +8,9 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { AdminGetReturnReasonsParamsType } from "./validators"
|
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetReturnReasonsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminReturnReasonListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminReturnReasonListResponse>
|
res: MedusaResponse<HttpTypes.AdminReturnReasonListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import { AdminPostReturnsReqSchemaType } from "./validators"
|
import { AdminPostReturnsReqSchemaType } from "./validators"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminOrderFilters>,
|
||||||
res: MedusaResponse<HttpTypes.AdminReturnsResponse>
|
res: MedusaResponse<HttpTypes.AdminReturnsResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -8,14 +8,10 @@ import {
|
|||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { refetchSalesChannel } from "./helpers"
|
import { refetchSalesChannel } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreateSalesChannelType,
|
|
||||||
AdminGetSalesChannelsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetSalesChannelsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminSalesChannelListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminSalesChannelListResponse>
|
res: MedusaResponse<HttpTypes.AdminSalesChannelListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -40,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateSalesChannelType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateSalesChannel>,
|
||||||
res: MedusaResponse<HttpTypes.AdminSalesChannelResponse>
|
res: MedusaResponse<HttpTypes.AdminSalesChannelResponse>
|
||||||
) => {
|
) => {
|
||||||
const salesChannelsData = [req.validatedBody]
|
const salesChannelsData = [req.validatedBody]
|
||||||
|
|||||||
@@ -9,13 +9,9 @@ import {
|
|||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { refetchShippingOption } from "./helpers"
|
import { refetchShippingOption } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreateShippingOptionType,
|
|
||||||
AdminGetShippingOptionsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetShippingOptionsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminShippingOptionListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminShippingOptionListResponse>
|
res: MedusaResponse<HttpTypes.AdminShippingOptionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
@@ -40,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateShippingOptionType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateShippingOption>,
|
||||||
res: MedusaResponse<HttpTypes.AdminShippingOptionResponse>
|
res: MedusaResponse<HttpTypes.AdminShippingOptionResponse>
|
||||||
) => {
|
) => {
|
||||||
const shippingOptionPayload = req.validatedBody
|
const shippingOptionPayload = req.validatedBody
|
||||||
|
|||||||
Reference in New Issue
Block a user