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

Add Activity favorites #80

Merged
merged 2 commits into from Aug 31, 2018

Conversation

@imath
Copy link
Contributor

commented Aug 30, 2018

The idea is to implement it a bit differently than how it is done in AJAX. The user is updating their favorites for a specific activity Rest request.
When fetching activities so that it is easy for a client to know whether an activity is favorited or not, i have updated the schema with a readonly property (favorited).
I am only getting the user favorites for get_items/get_item and update_favorite methods as i dont think we need it elsewhere

Add user favorites
The idea is to implement it a bit differently than how it is done in AJAX. The user is updating their favorites for a specific activity Rest request.
When fetching activities so that it is easy for a client to know whether an activity is favorited or not, i have updated the schema with a readonly property (favorited).
I am only getting the user favorites for get_items/get_item and update_favorite as i dont think we need it elsewhere

@renatonascalves renatonascalves added this to the v1 milestone Aug 31, 2018

@renatonascalves
Copy link
Member

left a comment

@imath I think we can keep it but it makes it harder to list all activities favourited by a user.

Show resolved Hide resolved includes/bp-activity/classes/class-bp-rest-activity-endpoint.php
if ( ! bp_activity_can_favorite() ) {
return new WP_Error( 'rest_activity_cannot_favorite',
__( 'Sorry, Activities cannot be favorited.', 'buddypress' ),

This comment has been minimized.

Copy link
@renatonascalves

renatonascalves Aug 31, 2018

Member

Activity, not Activities. We are not bulk-updating activities, so singular.

Show resolved Hide resolved includes/bp-activity/classes/class-bp-rest-activity-endpoint.php

@renatonascalves renatonascalves merged commit 6d0413d into buddypress:master Aug 31, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@renatonascalves

This comment has been minimized.

Copy link
Member

commented Aug 31, 2018

Thanks @imath :)

@renatonascalves renatonascalves added this to Done in BP REST - V1 Sep 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.