-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsettings.js
51 lines (48 loc) · 1.49 KB
/
settings.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
exports.getSettings = {
name: 'getSettings',
description: 'Returns all attendee\'s settings. Method: GET',
outputExample: {},
matchExtensionMimeType: false,
version: 1.0,
toDocument: true,
authenticated: true,
inputs: {
required: ['id'],
optional: [],
},
run: function(api, connection, next){
api.settings.get(connection.params.id, function(data) {
connection.response.response = data;
connection.response.count = data.length;
next(connection, true);
}).fail(function(err) {
connection.rawConnection.responseHttpCode = 500;
connection.response.error = err;
next(connection, true);
})
}
};
exports.updateSettings = {
name: 'updateSettings',
description: 'Updates all attendee\'s settings. Method: POST',
outputExample: {},
matchExtensionMimeType: false,
version: 1.0,
toDocument: true,
authenticated: true,
inputs: {
required: ['id', 'eventPushNotifications', 'allowPrivateMessages'],
optional: [],
},
run: function(api, connection, next){
api.settings.put(connection.params, function(data) {
connection.response.response = data;
connection.response.count = data.length;
next(connection, true);
}).fail(function(err) {
connection.rawConnection.responseHttpCode = 500;
connection.response.error = err;
next(connection, true);
})
}
};