Open stelcheck opened 11 years ago
Do you think, it should always be returned within an object like it currently is...
{
story: [{story1}, {story2}]
}
Or just an array of objects?
[{story1}, {story2}]
The first one, with a factory function is going to require us to pass in the key of the object as in 'story'. Unless you can think of a better way?
Why?
No stories (or other API call)
{}
One story
{
story: {}
}
One+ story
{
story: [{story}, {story}]
}
So no stories, just gives us an empty object, so we'd need to give it a key name in for consistancy.
We could change
// from
pivotal.apiCall = function (method, pathSegments, query, data, file, cb)
// to
pivotal.apiCall = function (method, pathSegments, query, data, file, keyName, cb)
Or alternatively see #22 & #23
Ideally, we will want to have some factory function for dealing with lists, and allowing us to simply plug that extra parser in each list API calls.