Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] shipment labels search returns empty arrays instead of objects #378

Closed
memen45 opened this issue Jan 20, 2024 · 1 comment
Closed

Comments

@memen45
Copy link

memen45 commented Jan 20, 2024

To Reproduce
Steps to reproduce the behavior:

  1. make a GET request to the shipment labels search endpoint /V1/postnl/shipments/label/search (described here) with the searchcriteria object in the query as usual (note the unusual use of 'criteria' instead of 'searchCriteria'):
criteria[pageSize]: 10
criteria[currentPage]: 1
criteria[sortOrders][0][field]: entity_id
criteria[sortOrders][0][direction]: DESC
criteria[filterGroups][0][filters][0][conditionType]: eq
criteria[filterGroups][0][filters][0][field]: product_code
criteria[filterGroups][0][filters][0][value]: 4946

Expected result
The response should contain a json with the items element set to an array of items. Example:

{
    "items": [
        { "entity_id": "21", .... etc etc },
        { "entity_id": "22", .... etc etc },
        { "entity_id": "23", .... etc etc },
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "product_code",
                        "value": "4946",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "sort_orders": [
            {
                "field": "entity_id",
                "direction": "DESC"
            }
        ],
        "page_size": 10,
        "current_page": 1
    },
    "total_count": 3
}

Actual result
The response contains empty arrays for each of the items that were found. Example:

{
    "items": [
        [],
        [],
        []
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "product_code",
                        "value": "4946",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "sort_orders": [
            {
                "field": "entity_id",
                "direction": "DESC"
            }
        ],
        "page_size": 10,
        "current_page": 1
    },
    "total_count": 3
}

Workaround
None

** Please complete the following information**

  • Magento version: 2.4.6-p2
  • PHP version: 8.1.2
  • TIG PostNL version: 1.12.9.1
@JorisPostNL
Copy link
Contributor

Hello @memen45, thank you for bringing this to our attention. We have developed a fix for this issue which we will release as soon as possible

Kind regards
Joris
PostNL Support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants