Skip to content

Commit

Permalink
Merge branch 'develop' into chore/trigger-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
olivermrbl authored May 6, 2024
2 parents e901ce2 + 36eff7f commit e1548a8
Show file tree
Hide file tree
Showing 189 changed files with 7,489 additions and 11,006 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProductCategoryService } from "@services"

import { Modules } from "@medusajs/modules-sdk"
import { IProductModuleService } from "@medusajs/types"
import { SuiteOptions, moduleIntegrationTestRunner } from "medusa-test-utils"
import { moduleIntegrationTestRunner, SuiteOptions } from "medusa-test-utils"
import { createProductCategories } from "../../../__fixtures__/product-category"
import {
eletronicsCategoriesData,
Expand Down Expand Up @@ -199,13 +199,13 @@ moduleIntegrationTestRunner({
mpath: "category-0.category-1.category-1-b.",
parent_category_id: "category-1",
category_children: [
{
expect.objectContaining({
id: "category-1-b-1",
handle: "category-1-b-1",
mpath: "category-0.category-1.category-1-b.category-1-b-1.",
parent_category_id: "category-1-b",
category_children: [],
},
}),
],
},
])
Expand Down
5 changes: 2 additions & 3 deletions packages/modules/product/src/repositories/product-category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ export class ProductCategoryRepository extends DALUtils.MikroOrmBaseTreeReposito
}

const shouldExpandParent =
familyOptions.includeAncestorsTree || fields.includes("parent_category")
familyOptions.includeAncestorsTree || populate.includes("parent_category") || fields.some(field => field.startsWith('parent_category'))

if (shouldExpandParent) {
populate.indexOf("parent_category") === -1 &&
populate.push("parent_category")
}

const shouldExpandChildren =
familyOptions.includeDescendantsTree ||
fields.includes("category_children")
familyOptions.includeDescendantsTree || populate.includes("category_children") || fields.some(field => field.startsWith('category_children'))

if (shouldExpandChildren) {
populate.indexOf("category_children") === -1 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data.
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* - name: order
* in: query
* description: Field to sort items in the list by.
* required: false
* schema:
* type: string
* title: order
* description: Field to sort items in the list by.
* security:
* - api_token: []
* - cookie_auth: []
Expand All @@ -26,6 +66,10 @@
* responses:
* "200":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminFulfillmentSetsDeleteResponse"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
Expand All @@ -38,6 +82,10 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,46 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data.
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* - name: order
* in: query
* description: Field to sort items in the list by.
* required: false
* schema:
* type: string
* title: order
* description: Field to sort items in the list by.
* security:
* - api_token: []
* - cookie_auth: []
Expand All @@ -36,6 +76,10 @@
* responses:
* "200":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminServiceZoneDeleteResponse"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
Expand All @@ -48,6 +92,10 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data.
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* - name: order
* in: query
* description: Field to sort items in the list by.
* required: false
* schema:
* type: string
* title: order
* description: Field to sort items in the list by.
* security:
* - api_token: []
* - cookie_auth: []
Expand All @@ -24,8 +64,6 @@
* tags:
* - Product Types
* responses:
* "200":
* description: OK
* "400":
* $ref: "#/components/responses/400_error"
* "401":
Expand All @@ -38,6 +76,10 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data.
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* - name: order
* in: query
* description: Field to sort items in the list by.
* required: false
* schema:
* type: string
* title: order
* description: Field to sort items in the list by.
* security:
* - api_token: []
* - cookie_auth: []
Expand All @@ -24,8 +64,6 @@
* tags:
* - Reservations
* responses:
* "200":
* description: OK
* "400":
* $ref: "#/components/responses/400_error"
* "401":
Expand All @@ -38,6 +76,10 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data.
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* - name: order
* in: query
* description: Field to sort items in the list by.
* required: false
* schema:
* type: string
* title: order
* description: Field to sort items in the list by.
* security:
* - api_token: []
* - cookie_auth: []
Expand All @@ -26,6 +66,10 @@
* responses:
* "200":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminShippingOptionDeleteResponse"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
Expand All @@ -38,6 +82,10 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/

Loading

0 comments on commit e1548a8

Please sign in to comment.