Skip to content

Orders GetServiceStatus  #100

Description

@Desmodue

When calling GetServiceStatus for the Orders API I get "Cannot read property 'list' of undefined" errors.
Looking through the code it would appear that /lib/request.js is checking for param.list when there isn't a param object.

I implemented a quick fix to check if param exists before trying to check if it has properties and executing this block of code. "if (param){" . This fixes the immediate error but I haven't had time to check if this is quite the right place to do this. Maybe the /lib/sections should define an empty params on GetServiceStatus ?

Here is the complete change, line 152 in /lib/request.js

            // Lists need to be sequentially numbered and we take care of that here
            if (param) {
                if (param.list) {
                    const values = _.map(toCollection(value), getValue);

                    _.forEach(values, (value, i) => {
                        this.values[`${param.name}.${i + 1}`] = value;
                    });
                } else {
                    this.values[param.name] = getValue(value);
                }
            }

Quite happy to do a pull request if this is ok

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions