Created
March 3, 2017 07:17
-
-
Save findchris/987a1ec39b09c1de3b587a0957a96d8b to your computer and use it in GitHub Desktop.
Handle POST /spaces/:id/events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/robin-js-sdk/lib/api/modules/spaces.js b/node_modules/robin-js-sdk/lib/api/modules/spaces.js | |
index c2cac7a..96d9886 100644 | |
--- a/node_modules/robin-js-sdk/lib/api/modules/spaces.js | |
+++ b/node_modules/robin-js-sdk/lib/api/modules/spaces.js | |
@@ -54,6 +54,28 @@ module.exports = { | |
}, | |
/** | |
+ * Space Events | |
+ * @type {Object} | |
+ */ | |
+ events: { | |
+ /** | |
+ * Create an event for a space | |
+ * @param {String|Integer} spaceIdentifier A Robin space identifier | |
+ * @param {Object} data A data object | |
+ * @return {Function} A Promise | |
+ */ | |
+ create: function(spaceIdentifier, data) { | |
+ var path; | |
+ if (spaceIdentifier && data) { | |
+ path = this.constructPath(constants.SPACES, spaceIdentifier, constants.EVENTS); | |
+ return this.Core.POST(path, data); | |
+ } else { | |
+ return this.rejectRequest('Bad Request: A space identifier and event data are required'); | |
+ } | |
+ } | |
+ }, | |
+ | |
+ /** | |
* Space Devices | |
* @type {Object} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment