sensei
sensei copied to clipboard
Fix/last activity sort
Fixes #5335
Changes proposed in this Pull Request
Previously, we sorted Students by Last Activity Date by manipulating the DB query. In https://github.com/Automattic/sensei/pull/5104 we extracted that out of the query and now we add that information to the query results to each user object. However, doing that broke the sorting by last activity.
What I'm doing here is moving the logic from parsing query arguments before the query to ordering after the query has been done.
Testing instructions
- Go to Sensei LMS -> Students
- Have at least 3 students with different
Last Activitytimes. - Click on the
Last Activitycolumn header - Make sure both ASC and DESC work as expected
Screenshot / Video
