Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: All API calls returning lists should return arrays #20

Open
stelcheck opened this issue Jun 7, 2013 · 3 comments
Open

Feature: All API calls returning lists should return arrays #20

stelcheck opened this issue Jun 7, 2013 · 3 comments

Comments

@stelcheck
Copy link
Member

  • getActivities
  • getProjectActivities
  • getProjects
  • getMemberships
  • getIterations
  • getDoneIterations
  • getBacklogIterations
  • getCurrentBacklogIterations
  • getStories (already done in 0.2.0)
  • getTasks

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.

@MRdNk
Copy link
Contributor

MRdNk commented Jun 9, 2013

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.

@MRdNk
Copy link
Contributor

MRdNk commented Jun 9, 2013

We could change

// from
pivotal.apiCall = function (method, pathSegments, query, data, file, cb) 

// to
pivotal.apiCall = function (method, pathSegments, query, data, file, keyName, cb) 

@MRdNk
Copy link
Contributor

MRdNk commented Jun 9, 2013

Or alternatively see #22 & #23

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

No branches or pull requests

2 participants