We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5718ad8 commit 21d250bCopy full SHA for 21d250b
lib/actions/checkAvailability.js
@@ -1,14 +1,16 @@
1
const elasticio = require('elasticio-node');
2
const messages = elasticio.messages;
3
const ApiClient = require('../apiClient');
4
+
5
module.exports.process = processAction;
6
7
async function processAction(msg, cfg) {
8
try {
9
const client = ApiClient(cfg);
10
let currentTime = msg.body.time || (new Date()).toISOString();
11
let events = await client.get(`/me/events?$filter=start/dateTime le '${currentTime}'
12
and end/dateTime ge '${currentTime}'`);
- this.emit('date', messages.newMessageWithBody({
13
+ this.emit('data', messages.newMessageWithBody({
14
available: !events.value.length
15
}));
16
} catch (e) {
0 commit comments