Skip to content

Commit

Permalink
Merge pull request #1542 from boxwise/base-products-default-filter-ty…
Browse files Browse the repository at this point in the history
…pe-all

Return products of All type by default in Base.products fields
  • Loading branch information
HaGuesto authored Sep 16, 2024
2 parents d9d3644 + e6723c1 commit 0f676ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ input FilterBoxInput {

input FilterProductInput {
includeDeleted: Boolean = false
type: ProductTypeFilter = Custom
type: ProductTypeFilter = All
}

input FilterBaseInput {
Expand Down
4 changes: 2 additions & 2 deletions back/boxtribute_server/graph_ql/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def derive_product_filter(filter_input):
parameters given, return empty conditions (i.e. no filtering applied).
"""
include_deleted = False
type_filter = ProductTypeFilter.Custom
type_filter = ProductTypeFilter.All
if filter_input:
include_deleted = filter_input.get("include_deleted")
type_filter = filter_input.get("type", ProductTypeFilter.Custom)
type_filter = filter_input.get("type", ProductTypeFilter.All)

conditions = []

Expand Down
2 changes: 1 addition & 1 deletion back/test/endpoint_tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_product_query(read_only_client, default_product, default_size, another_
"filter_input,ids",
[
# Test case 8.1.26
["includeDeleted: true", [1, 3, 4]],
["includeDeleted: true", [1, 3, 4, 5, 6]],
["type: Custom", [1, 3]],
["type: StandardInstantiation", [5]],
["type: All", [1, 3, 5]],
Expand Down

0 comments on commit 0f676ff

Please sign in to comment.