Skip to content

Commit

Permalink
feat: remove event (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyer3d authored Sep 14, 2022
1 parent 6940d75 commit 355dd40
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ulms/api-clients",
"version": "5.10.0",
"version": "5.10.1",
"description": "JavaScript API clients for ULMS platform",
"keywords": [],
"homepage": "https://github.com/foxford/ulms-api-clients-js#readme",
Expand Down
22 changes: 22 additions & 0 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,28 @@ class Event extends Service {
return this.rpc.send('event.create', parameters)
}

/**
* Sets the flag "removed" for the event
* @param {uuid} roomId
* @param {String} type
* @param {Object|String|Number} data
* @param {Object} eventParameters event parameters: attribute, is_claim, is_persistent, label, set, removed
* for more information see: https://github.com/foxford/event/blob/master/docs/src/api/event/create.md
*
* @returns {Promise}
*/
createRemovalEvent(roomId, type, data, eventParameters = {}) {
const parameters = {
...eventParameters,
data,
room_id: roomId,
type,
removed: true,
}

return this.rpc.send('event.create', parameters)
}

/**
* List events
* @param {uuid} roomId
Expand Down

0 comments on commit 355dd40

Please sign in to comment.