MDL-66074 mod_forum: Add sorting in WS for discussion fetching
authorMathew May <mathewm@hotmail.co.nz>
Mon, 28 Oct 2019 05:16:51 +0000 (13:16 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Wed, 30 Oct 2019 05:03:59 +0000 (13:03 +0800)
mod/forum/amd/build/repository.min.js
mod/forum/amd/build/repository.min.js.map
mod/forum/amd/src/repository.js

index cea397e..c7ca03d 100644 (file)
Binary files a/mod/forum/amd/build/repository.min.js and b/mod/forum/amd/build/repository.min.js differ
index 4fe16e3..4b83ba5 100644 (file)
Binary files a/mod/forum/amd/build/repository.min.js.map and b/mod/forum/amd/build/repository.min.js.map differ
index fceeef7..3005ae2 100644 (file)
@@ -138,13 +138,17 @@ define(['core/ajax'], function(Ajax) {
      * Get the posts for the discussion ID provided.
      *
      * @param {number} discussionId
+     * @param {String} sortby
+     * @param {String} sortdirection
      * @return {*|Promise}
      */
-    var getDiscussionPosts = function(discussionId) {
+    var getDiscussionPosts = function(discussionId, sortby = 'created', sortdirection = 'ASC') {
         var request = {
             methodname: 'mod_forum_get_discussion_posts',
             args: {
                 discussionid: discussionId,
+                sortby: sortby,
+                sortdirection: sortdirection,
             },
         };
         return Ajax.call([request])[0];