Skip to content

Commit

Permalink
Update /api/users/general and /api/users/detail to match users-*
Browse files Browse the repository at this point in the history
pattern used by all other URL routes.
  • Loading branch information
bryanlandia committed Jun 10, 2021
1 parent 4380ee8 commit d09248a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions figures/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
base_name='courses-detail')

router.register(
r'users/general',
r'users-general',
views.GeneralUserDataViewSet,
base_name='users-general')

router.register(
r'users/detail',
r'users-detail',
views.LearnerDetailsViewSet,
base_name='users-detail')

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/apiConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const apiConfig = {
generalSiteMetrics: '/figures/api/general-site-metrics/',
coursesGeneral: '/figures/api/courses-general/',
coursesDetailed: '/figures/api/courses-detail/',
learnersGeneral: '/figures/api/users/general/',
learnersDetailed: '/figures/api/users/detail/',
learnersGeneral: '/figures/api/users-general/',
learnersDetailed: '/figures/api/users-detail/',
reportingCsvReportsApi: '/reporting/api/csv-reports/',
coursesIndex: '/figures/api/courses-index/',
learnerMetrics: '/figures/api/learner-metrics/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CourseLearnersList extends Component {
/** Render the learners list for the course page
API endpoint source of data:
figures/api/users/detail/?enrolled_in_course_id=<course-id>
figures/api/users-detail/?enrolled_in_course_id=<course-id>
*/
render() {

Expand Down
10 changes: 5 additions & 5 deletions old-docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Open edX has different roles, such as, but not limited to learner (or student),
To get a list of users with summary data:

```
/figures/api/users/general/
/figures/api/users-general/
```

### User Details
Expand All @@ -328,25 +328,25 @@ To get a list of users with summary data:
To get details for all users:

```
/figures/api/users/detail/
/figures/api/users-detail/
```

To get details for a specific user, provide the user id:

```
/figures/users/detail/10
/figures/users-detail/10
```

To select a set of users, add the `user_ids` query parameter followed by a list of ids:

```
/figures/api/users/detail/?user_ids=1,2,3
/figures/api/users-detail/?user_ids=1,2,3
```

To get all the users (learner) enrolled in a course, provide the course id in the `enrolled_in_course_id` query param:

```
/fgures/api/users/detail/?enrolled_in_course_id=course-v1:edX+DemoX+Demo_Course
/fgures/api/users-detail/?enrolled_in_course_id=course-v1:edX+DemoX+Demo_Course
```


Expand Down
2 changes: 1 addition & 1 deletion tests/views/test_general_user_data_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TestGeneralUserViewSet(BaseViewTest):
"""Tests the UserIndexView view class
"""

request_path = 'api/users/general'
request_path = 'api/users-general'
view_class = GeneralUserDataViewSet
@pytest.fixture(autouse=True)
def setup(self, db):
Expand Down
4 changes: 2 additions & 2 deletions tests/views/test_learner_details_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class TestLearnerDetailsViewSetStandalone(BaseViewTest):
'''Tests the UserIndexView view class
'''

request_path = 'api/users/detail/'
request_path = 'api/users-detail/'
view_class = LearnerDetailsViewSet
@pytest.fixture(autouse=True)
def setup(self, db, settings):
Expand Down Expand Up @@ -231,7 +231,7 @@ class TestLearnerDetailsViewSetMultisite(BaseViewTest):
'''Tests the UserIndexView view class
'''

request_path = 'api/users/detail/'
request_path = 'api/users-detail/'
view_class = LearnerDetailsViewSet
@pytest.fixture(autouse=True)
def setup(self, db, settings):
Expand Down

0 comments on commit d09248a

Please sign in to comment.