Skip to content

Fix sort parameter handling#126

Closed
timwedde wants to merge 1 commit intoGeotab:mainfrom
timwedde:fix/sort-parameter
Closed

Fix sort parameter handling#126
timwedde wants to merge 1 commit intoGeotab:mainfrom
timwedde:fix/sort-parameter

Conversation

@timwedde
Copy link

@timwedde timwedde commented Jun 3, 2025

The sort parameter is mishandled in the API class in that it is entirely ignored, leading to it becoming part of the search dict. This, in turn, makes it non-functional. This PR fixes this in the same way that the result_limit property is handled.

In the current implementation, the resulting param set looks like this:

{
    "id": -1,
    "method": "Get",
    "params": {
        "search": {
            "sort": {"sortBy": "date", "sortDirection": "desc", "offset": None, "lastId": None},
            "deviceSearch": {"id": "<myID>"},
        },
        "resultsLimit": 3,
        "typeName": "DriverChange",
        "credentials": <removed>,
    },
}

@aaront
Copy link
Contributor

aaront commented Oct 24, 2025

Fixed in #127. Thanks for your PR!

I ended up making a few more improvements and extracting the parameter handling into its own file.

@aaront aaront closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants