Skip to content

Commit

Permalink
change to ignore products
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Jun 24, 2024
1 parent 4acc308 commit 4db1dba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions packages/medusa/src/models/product-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export class ProductCollection extends SoftDeletableEntity {
@Column({ nullable: true })
handle: string

/**
* @apiIgnore
*/
@OneToMany(() => Product, (product) => product.collection)
products: Relation<Product>[]

Expand Down Expand Up @@ -69,6 +72,13 @@ export class ProductCollection extends SoftDeletableEntity {
* nullable: true
* type: string
* example: summer-collection
* products:
* description: The details of the products that belong to this product collection.
* type: array
* x-expandable: "products"
* x-ignore: true
* items:
* $ref: "#/components/schemas/Product"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const TagOperationParameters = ({
const propertyName = schemaObject.parameterName || schemaObject.title || ""

const getElement = () => {
if (schemaObject["x-ignore"]) {
return <></>
}

if (schemaObject.anyOf || schemaObject.allOf) {
return (
<TagOperationParametersUnion
Expand Down Expand Up @@ -106,8 +110,6 @@ const TagOperationParameters = ({
isRequired={isRequired}
/>
)

return <></>
}

return <div className={className}>{getElement()}</div>
Expand Down
1 change: 1 addition & 0 deletions www/apps/api-reference/types/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export type SchemaObject = (ArraySchemaObject | NonArraySchemaObject) & {
isRequired?: boolean
"x-featureFlag"?: string
"x-expandable"?: string
"x-ignore"?: boolean
}

export type PropertiesObject = {
Expand Down

0 comments on commit 4db1dba

Please sign in to comment.