feat(medusa): Add has_account to list-customers query params (#2811)
This commit is contained in:
1 parent
6283010fd6
commit
c16522d6ce
6 files changed
+42
-6
No files matched your search
@@ -10,6 +10,7 @@ import { AdminGetDiscountsDiscountRuleParams } from "../../../../types/discount"
|
||||
import { extendedFindParamsMixin } from "../../../../types/common"
|
||||
import { Request, Response } from "express"
|
||||
import { DiscountService } from "../../../../services"
|
||||
import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts
|
||||
@@ -127,11 +128,11 @@ export class AdminGetDiscountsParams extends extendedFindParamsMixin({
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === "true")
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
is_dynamic?: boolean
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === "true")
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
is_disabled?: boolean
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "."
|
||||
import { EntityManager } from "typeorm"
|
||||
import { OrderService } from "../../../../services"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
|
||||
/**
|
||||
* @oas [post] /orders/{id}/fulfillment
|
||||
@@ -147,7 +148,7 @@ export class AdminPostOrdersOrderFulfillmentsReq {
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === "true")
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
no_notification?: boolean
|
||||
|
||||
@IsObject()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { IsOptional, IsString } from "class-validator"
|
||||
import { Transform } from "class-transformer"
|
||||
import { IsBoolean, IsOptional, IsString } from "class-validator"
|
||||
import { optionalBooleanMapper } from "../utils/validators/is-boolean"
|
||||
import { AddressPayload } from "./common"
|
||||
|
||||
export class AdminListCustomerSelector {
|
||||
@@ -6,6 +8,11 @@ export class AdminListCustomerSelector {
|
||||
@IsOptional()
|
||||
q?: string
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
has_account?: boolean
|
||||
|
||||
@IsOptional()
|
||||
@IsString({ each: true })
|
||||
groups?: string[]
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
DiscountRuleType,
|
||||
Region,
|
||||
} from "../models"
|
||||
import { optionalBooleanMapper } from "../utils/validators/is-boolean"
|
||||
import { ExactlyOne } from "./validators/exactly-one"
|
||||
|
||||
export type QuerySelector = {
|
||||
@@ -28,12 +29,12 @@ export class FilterableDiscountProps {
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === "true")
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
is_dynamic?: boolean
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === "true")
|
||||
@Transform(({ value }) => optionalBooleanMapper.get(value))
|
||||
is_disabled?: boolean
|
||||
|
||||
@ValidateNested()
|
||||
|
||||
Reference in new issue
Block a user