Open thomasplevy opened 4 years ago
related, but maybe they worth another ticket:
we never return a 404 here, we always return a validation error as the post_id
was wrong:
https://github.com/gocodebox/lifterlms-rest/blob/1.0.0-beta.14/includes/server/class-llms-rest-students-progress-controller.php#L528
@thomasplevy Can you help_with/validate the following too? https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments too
@thomasplevy Can you help_with/validate the following too? https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments too
- https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments/paths/~1students~1{id}~1enrollments/get 404 when the student doesn't exist
- https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments/paths/~1students~1{id}~1enrollments~1{post_id}/get https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments/paths/~1students~1{id}~1enrollments~1{post_id}/post 404 when the student or the post/course don't exist
- https://developer.lifterlms.com/rest-api/#tag/Student-Enrollments/paths/~1students~1{id}~1enrollments~1{post_id}/patch 404 when the student or the post/course or the enrollment itself don't exist
You are correct on the way all of these should be working
Mmm well no to me it meant that the enrollments did not exist, so it's my wrong understanding of the specs: BUG. Maybe the spec could be more "complete" if they said what was the actual resource that couldn't be found.
I did the same with:
they must be fixed then! Sorry!
Originally posted by @eri-trabiccolo in https://github.com/gocodebox/lifterlms-rest/issues/178#issuecomment-653159049
See related #178
The following endpoints must be updated to respond with a 200 (not a 404) when no enrollments (or content) are found:
[ ]
GET /memberships/{id}/enrollments
[ ]
GET /courses/{id}/enrollments
[ ]
GET /courses/{id}/content
[ ]
GET /sections/{id}/content
[ ] The spec (for all endpoints) should be updated to note that the "resource" that is not found by the 404 is the course, membership, etc... and not the list enrollments