Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 22... Línea 22...
22
 */
22
 */
Línea 23... Línea 23...
23
 
23
 
Línea 24... Línea 24...
24
import ajax from "core/ajax";
24
import ajax from "core/ajax";
25
 
25
 
26
/**
26
/**
27
 * Given a course ID, we want to fetch the groups, so we may fetch their users.
27
 * Given a course ID and optionally a module ID, we want to fetch the groups, so we may fetch their users.
28
 *
28
 *
-
 
29
 * @method groupFetch
29
 * @method groupFetch
30
 * @param {int} courseid ID of the course to fetch the groups of.
30
 * @param {int} courseid ID of the course to fetch the users of.
31
 * @param {int|null} cmid ID of the course module initiating the group search (optional).
31
 * @return {object} jQuery promise
32
 * @return {object} jQuery promise
32
 */
33
 */
33
export const groupFetch = (courseid) => {
34
export const groupFetch = (courseid, cmid = null) => {
34
    const request = {
35
    const request = {
35
        methodname: 'core_group_get_groups_for_selector',
36
        methodname: 'core_group_get_groups_for_selector',
-
 
37
        args: {
36
        args: {
38
            courseid: courseid,
37
            courseid: courseid,
39
            cmid: cmid,
38
        },
40
        },
39
    };
41
    };