ushahidi / Ushahidi_Web

Ushahidi v2. A platform that allows information collection, visualization and interactive mapping, allowing anyone to submit information through text messaging using a mobile phone, email or web form.
http://www.ushahidi.com
Other
901 stars 624 forks source link

Add comments to reports api call by default #877

Open eyedol opened 12 years ago

eyedol commented 12 years ago

"Comments Not Attached To Reports via An API call"

Steps to reproduce this.

  1. Go to api?task=incidents&by=all&limit=20&resp=json
  2. Look at the JSON output
  3. Pay attention to the comments key.

Expected result: Comments posted to reports should be retrievable via the API call.

Actual result: No comments at all. Just an empty JSON value for comments.

Tested on latest develop code.

rjmackay commented 12 years ago

@eyedol the api call you want is: api?task=incidents&by=all&limit=20&resp=json&comments=1 Comments aren't included by default. Though that behaviour could probably change if needed.

rjmackay commented 12 years ago

Closing since this is more "by design" .. reopen if needed

eyedol commented 12 years ago

Then it's confusing. It makes more sense for the comments to show by default than adding another parameter to get it to show

rjmackay commented 12 years ago

Agreed. I'll reopen this and rename it as a change rather than a bug. This was actually one of the first pull requests I submitted about a year ago.. so I think comments were only optional as I wasn't sure what might break apps using the API or effect load etc.. didn't want to mess with things too much :)

bodacea commented 10 years ago

I've added this to the V3 features wishlist at https://phabricator.ushahidi.com/T554 (so we don't forget to do this for V3); please feel free to continue working on this for V2.