fix(medusa): Expose list-currencies endpoint by removing feature flag guard (#2216)
This commit is contained in:
@@ -4,7 +4,7 @@ import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/ta
|
||||
import { PaginatedResponse } from "../../../../types/common"
|
||||
import middlewares, {
|
||||
transformBody,
|
||||
transformQuery,
|
||||
transformQuery
|
||||
} from "../../../middlewares"
|
||||
import { isFeatureFlagEnabled } from "../../../middlewares/feature-flag-enabled"
|
||||
import { AdminGetCurrenciesParams } from "./list-currencies"
|
||||
@@ -14,7 +14,6 @@ export default (app) => {
|
||||
const route = Router()
|
||||
app.use(
|
||||
"/currencies",
|
||||
isFeatureFlagEnabled(TaxInclusivePricingFeatureFlag.key),
|
||||
route
|
||||
)
|
||||
|
||||
@@ -29,6 +28,7 @@ export default (app) => {
|
||||
route.post(
|
||||
"/:code",
|
||||
transformBody(AdminPostCurrenciesCurrencyReq),
|
||||
isFeatureFlagEnabled(TaxInclusivePricingFeatureFlag.key),
|
||||
middlewares.wrap(require("./update-currency").default)
|
||||
)
|
||||
|
||||
@@ -45,3 +45,4 @@ export type AdminCurrenciesRes = {
|
||||
|
||||
export * from "./list-currencies"
|
||||
export * from "./update-currency"
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { IsBoolean, IsOptional, IsString } from "class-validator"
|
||||
import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/tax-inclusive-pricing"
|
||||
import { Currency } from "../../../../models"
|
||||
import { CurrencyService } from "../../../../services"
|
||||
import { FindPaginationParams } from "../../../../types/common"
|
||||
import { ExtendedRequest } from "../../../../types/global"
|
||||
import { FindConfig, FindPaginationParams } from "../../../../types/common"
|
||||
import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators"
|
||||
|
||||
/**
|
||||
* @oas [get] /currencies
|
||||
@@ -66,8 +68,10 @@ export class AdminGetCurrenciesParams extends FindPaginationParams {
|
||||
@IsOptional()
|
||||
code?: string
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@FeatureFlagDecorators(TaxInclusivePricingFeatureFlag.key, [
|
||||
IsBoolean(),
|
||||
IsOptional(),
|
||||
])
|
||||
includes_tax?: boolean
|
||||
|
||||
@IsString()
|
||||
|
||||
Reference in New Issue
Block a user