Merge lp:~peterm-ubuntu/resource-centre/rest-fix into lp:resource-centre
Status: | Merged |
---|---|
Approved by: | Anthony Dillon |
Approved revision: | 107 |
Merged at revision: | 107 |
Proposed branch: | lp:~peterm-ubuntu/resource-centre/rest-fix |
Merge into: | lp:resource-centre |
Diff against target: |
264 lines (+99/-29) 2 files modified
functions/event-posts.php (+61/-23) functions/profile.php (+38/-6) |
To merge this branch: | bzr merge lp:~peterm-ubuntu/resource-centre/rest-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Dillon | Approve | ||
Review via email: mp+341853@code.launchpad.net |
Description of the change
## Done
- Created the /event rest api endpoint with custom fields
- Added custom user fields to the /users rest api endpoint
## QA
- Check out this branch locally, or try on insights.
- View the api in your web browser at:
- [event](https:/
- see that the endpoint exists and the custom fields are there:
```
"_event_
"_event_venue": "Vancouver Convention Center",
"_event_
"_start_day": "18",
"_start_month": "05",
"_start_year": "2015",
"_end_day": "22",
"_end_month": "06",
"_end_year": "2016",
```
- [user](https:/
- see that the custom fields are there:
```
"user_
"user_
"user_google": "10288495482815
"user_twitter": "",
"user_
"user_photo": "/wp-content/
"user_
```
Great stuff. Although it seems the `id` does not filter the feed by the single post. For example: http:// insights. canonicalwebtea m.com/wp- json/wp/ v2/event? _embed= True&id= 6180 returns all the events not just the data for the 6180 event.
I think we need some logic in the event function to return all or a single post if the id exists. Also the events feed takes a long time. I think we need to limit the results.