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 REST API support #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add REST API support #59

wants to merge 2 commits into from

Conversation

rmccue
Copy link
Member

@rmccue rmccue commented May 29, 2019

Adds a new falcon_preferences field to the users endpoint. This looks like:

{
  "id": 1,
  ...
  "falcon_preferences": {
    "wordpress": {
      "post": "all",
      "comment": "all"
    },
    "bbpress": {
      "topic": "",
      "reply": "all"
    }
  }
}

This generates the schema automatically based on the existing helpers, but only if the connector is using the helpers (introduced in #56 and #57).

@rmccue rmccue requested a review from joehoyle May 29, 2019 18:07
Copy link
Member

@joehoyle joehoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a pref.

@@ -0,0 +1,129 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should have REST in the class name.

* @param array $data Full response data.
* @return array Data for the field.
*/
public static function get_pref_field( $data ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why name the functions tersely like this?

Suggested change
public static function get_pref_field( $data ) {
public static function get_preference_field( $data ) {

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

Successfully merging this pull request may close these issues.

2 participants