-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
27 lines (20 loc) · 996 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var generateCourseAccessData = require('course-access-data.js').generate,
toolAccessConsts = require('course-access-data.js').consts
utils = require('utils.js');
/**
* /d2l/api/adp/unstable/aggregatedEvents
*/
Sandbox.define('/d2l/api/adp/unstable/aggregatedEvents/{id}/{orgId}/Course Offering','GET', function(req, res) {
var dates = utils.parseDates(req.query.startTime, req.query.endTime);
var result = generateCourseAccessData(req.params.orgId, undefined, dates.startTime, dates.endTime);
res.type('application/json');
res.status(200);
res.json(result);
});
Sandbox.define('/d2l/api/adp/unstable/aggregatedEvents/{id}/{orgId}/Course Offering/{roleId}','GET', function(req, res) {
var dates = utils.parseDates(req.query.startTime, req.query.endTime);
var result = generateCourseAccessData(req.params.orgId, req.params.roleId, dates.startTime, dates.endTime);
res.type('application/json');
res.status(200);
res.json(result);
});