Skip to content

Commit

Permalink
fixup! feat(oas): declare x-expanded-relations - Store
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-medusajs committed Mar 15, 2023
1 parent 197d6cb commit d41c3d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export default (app) => {
return app
}

export const defaultRelations = ["requirements"]

/**
* @schema StoreShippingOptionsListRes
* type: object
* x-expanded-relations:
* field: shipping_options
* implicit:
* relations:
* - requirements
* required:
* - shipping_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IsBooleanString, IsOptional, IsString } from "class-validator"
import { PricingService, ProductService } from "../../../../services"
import ShippingOptionService from "../../../../services/shipping-option"
import { validator } from "../../../../utils/validator"
import { defaultRelations } from "."

/**
* @oas [get] /store/shipping-options
Expand Down Expand Up @@ -80,7 +81,7 @@ export default async (req, res) => {
}

const options = await shippingOptionService.list(query, {
relations: ["requirements"],
relations: defaultRelations,
})

const data = await pricingService.setShippingOptionPrices(options)
Expand Down

0 comments on commit d41c3d4

Please sign in to comment.