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 d9d046a commit 197d6cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import EventBusService from "../../../../services/event-bus"
import IdempotencyKeyService from "../../../../services/idempotency-key"
import ReturnService from "../../../../services/return"
import { validator } from "../../../../utils/validator"
import { defaultRelations } from "."

/**
* @oas [post] /store/returns
Expand Down Expand Up @@ -172,7 +173,7 @@ export default async (req, res) => {
idempotency_key: idempotencyKey.idempotency_key,
},
{
relations: ["items", "items.reason"],
relations: defaultRelations,
}
)
if (!returnOrders.length) {
Expand Down
7 changes: 5 additions & 2 deletions packages/medusa/src/api/routes/store/returns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ export default (app) => {
return app
}

export const defaultRelations = ["items", "items.reason"]

/**
* @schema StoreReturnsRes
* type: object
* x-expanded-relations:
* field: return
* eager:
* relations:
* - items
* implicit:
* - items.reason
* eager:
* - items
* required:
* - return
* properties:
Expand Down

0 comments on commit 197d6cb

Please sign in to comment.