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

Inconsistent response format between member and moderator endpoints #440

Open
jenningsanderson opened this issue Apr 7, 2023 · 1 comment

Comments

@jenningsanderson
Copy link

The member endpoint is paginated while the moderator endpoint is not paginated. This seems fine, however, the response format is slightly different, which is a bit confusing:

Example: https://mapping.team/api/teams/110/moderators returns

[
  {
    "id": 151,
    "team_id": 110,
    "osm_id": 1770239
  },
...
]

While https://mapping.team/api/teams/110/members returns:

{
  "teamId": 110,
  "members": {
    "data": [
      {
        "id": 14962448,
        "name": "Abdul-Nayar Rabiatu Sungumu"
      },
      {
        "id": 4814747,
        "name": "Abdul OSM"
      },
      ...
    ],
    "pagination": {
      "total": 39,
      "lastPage": 4,
      "perPage": 10,
      "currentPage": 1,
      "from": 0,
      "to": 10
    }
  }
}

The primary inconsistency here is the difference between id and osm_id between the moderators and members.

Not a bug, just something worth documenting carefully.

@jenningsanderson
Copy link
Author

One more note on pagination, the perPage argument does not work universally, so far I've only found it to work on organization teams.

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

No branches or pull requests

1 participant