UiPath / orchestrator-nodejs

MIT License
8 stars 7 forks source link

activeOrganizationUnitId is overwritten by subsequent requests #8

Open bogdanripa opened 2 years ago

bogdanripa commented 2 years ago

If I have multiple get (for ex) requests with different activeOrganizationUnitIds, the last one will be used. The reason is that the _activeOrganizationUnitId variable is orchestrator-scoped instead of element-scoped.

To fix this:

Update line 267/228:

    if (element._activeOrganizationUnitId !== -1) {
        options.headers[ORGANIZATION_UNIT_ID_HEADER] = element._activeOrganizationUnitId;

Add line 357:

        _activeOrganizationUnitId: this._activeOrganizationUnitId,