coralproject / pillar

Deprecated: Service layer for the Coral ecosystem
Other
4 stars 1 forks source link

ability to get a count of submissions per form #153

Closed riley closed 8 years ago

riley commented 8 years ago

In order to build the pagination feature as designed here https://github.com/coralproject/cay/issues/414 I need a count of submissions so I can have a button go to the last page of submissions.

The endpoint should be GET /api/form_submissions/<form_id>/count and just return either a raw number in the response, or a json object {count: 5}, whichever you prefer.

This issue is blocking https://github.com/coralproject/cay/issues/299

jde commented 8 years ago

I think the value is already embedded in the form itself. (I added it to populate the counts on the form list page.)

form {
   ...
   stats: {
      responses: n
   }
   ...
}

Is making a separate call still necessary?

jde commented 8 years ago

... but either way I should update "responses" to "submissions" for consistency. We will need to coordinate this with a change to the form list page.

riley commented 8 years ago

hah, perfect. I didn't know about that. responses could be submissionCount or something. My first thought would be that responses would be an array of the responses, but it's not a huge deal. File it under nice-to-have.