Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[fix] When only one cloud is passed to
Client.prototype.cloud
then …
…respond with an unwrapped result.
- Loading branch information
bd283e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@3rd-Eden I believe that this is one of the sources for your problem with the api returning:
You're mapping over the
clouds
for the specifiedoptions.appName
here and then directly returning those results in the line removed from this commit.So since
POST /apps/:user/:app/cloud
returns an Array, you were responding with an Array of Arrays.bd283e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@indexzero I thought that it was already fixed as it was caused by something else. But this fix seems reasonable as the mapping does indeed wrap everything in an Array. My only concern here is that the response will change once we call multiple datacenters and it might not be obvious of where that's coming from. But that's probably something for later.
bd283e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I do find a bit odd and disturbing that everything was still working and the tests passed if it was always returning the result wrapped in a Array