fix(medusa): Query SalesChannel Products in storefront (#2272)
This commit is contained in:
1 parent
a2bb504e6e
commit
8797a1441b
5 files changed
+131
-26
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { IsNumber, IsOptional, IsString } from "class-validator"
|
||||
import { PricingService, ProductService } from "../../../../services"
|
||||
|
||||
import { FilterableProductProps } from "../../../../types/product"
|
||||
import { PricedProduct } from "../../../../types/pricing"
|
||||
import { Product } from "../../../../models"
|
||||
import { Type } from "class-transformer"
|
||||
import { Product } from "../../../../models"
|
||||
import { PricedProduct } from "../../../../types/pricing"
|
||||
import { FilterableProductProps } from "../../../../types/product"
|
||||
|
||||
/**
|
||||
* @oas [get] /products
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
import {
|
||||
CartService,
|
||||
ProductService,
|
||||
RegionService,
|
||||
} from "../../../../services"
|
||||
import { Transform, Type } from "class-transformer"
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
ValidateNested
|
||||
} from "class-validator"
|
||||
import { Transform, Type } from "class-transformer"
|
||||
import { omit, pickBy } from "lodash"
|
||||
import {
|
||||
CartService,
|
||||
ProductService,
|
||||
RegionService
|
||||
} from "../../../../services"
|
||||
|
||||
import { DateComparisonOperator } from "../../../../types/common"
|
||||
import { IsType } from "../../../../utils/validators/is-type"
|
||||
import { PriceSelectionParams } from "../../../../types/price-selection"
|
||||
import PricingService from "../../../../services/pricing"
|
||||
import { Product } from "../../../../models"
|
||||
import { defaultStoreProductsRelations } from "."
|
||||
import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
import SalesChannelFeatureFlag from "../../../../loaders/feature-flags/sales-channels"
|
||||
import { Product } from "../../../../models"
|
||||
import PricingService from "../../../../services/pricing"
|
||||
import { DateComparisonOperator } from "../../../../types/common"
|
||||
import { PriceSelectionParams } from "../../../../types/price-selection"
|
||||
import { isDefined } from "../../../../utils"
|
||||
import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
import { IsType } from "../../../../utils/validators/is-type"
|
||||
|
||||
/**
|
||||
* @oas [get] /products
|
||||
@@ -294,6 +296,12 @@ export class StoreGetProductsParams extends StoreGetProductsPaginationParams {
|
||||
@IsOptional()
|
||||
type?: string
|
||||
|
||||
@FeatureFlagDecorators(SalesChannelFeatureFlag.key, [
|
||||
IsOptional(),
|
||||
IsArray(),
|
||||
])
|
||||
sales_channel_id?: string[]
|
||||
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => DateComparisonOperator)
|
||||
|
||||
@@ -5,15 +5,17 @@ import {
|
||||
IsEnum,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
ValidateNested
|
||||
} from "class-validator"
|
||||
import SalesChannelFeatureFlag from "../loaders/feature-flags/sales-channels"
|
||||
import { Product, ProductOptionValue, ProductStatus } from "../models"
|
||||
import { FeatureFlagDecorators } from "../utils/feature-flag-decorators"
|
||||
import { optionalBooleanMapper } from "../utils/validators/is-boolean"
|
||||
import { IsType } from "../utils/validators/is-type"
|
||||
import {
|
||||
DateComparisonOperator,
|
||||
FindConfig,
|
||||
StringComparisonOperator,
|
||||
StringComparisonOperator
|
||||
} from "./common"
|
||||
import { PriceListLoadConfig } from "./price-list"
|
||||
|
||||
@@ -66,8 +68,10 @@ export class FilterableProductProps {
|
||||
@IsOptional()
|
||||
type?: string
|
||||
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@FeatureFlagDecorators(SalesChannelFeatureFlag.key, [
|
||||
IsOptional(),
|
||||
IsArray(),
|
||||
])
|
||||
sales_channel_id?: string[]
|
||||
|
||||
@IsOptional()
|
||||
|
||||
Reference in new issue
Block a user