@cocreate/organizations 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.3.1](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.3.0...v1.3.1) (2022-05-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * get orgId from socketInfo ([77348c3](https://github.com/CoCreate-app/CoCreate-organizations/commit/77348c30afa285c152754545b549464a7202eb94))
7
+
1
8
  # [1.3.0](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.2.5...v1.3.0) (2022-05-14)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/organizations",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A simple organizations component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "organizations",
package/src/server.js CHANGED
@@ -9,12 +9,12 @@ class CoCreateOrganization {
9
9
 
10
10
  init() {
11
11
  if (this.wsManager) {
12
- this.wsManager.on('createOrg', (socket, data, socketInfo) => this.createOrg(socket, data));
13
- this.wsManager.on('deleteOrg', (socket, data, socketInfo) => this.deleteOrg(socket, data));
12
+ this.wsManager.on('createOrg', (socket, data, socketInfo) => this.createOrg(socket, data, socketInfo));
13
+ this.wsManager.on('deleteOrg', (socket, data, socketInfo) => this.deleteOrg(socket, data, socketInfo));
14
14
  }
15
15
  }
16
16
 
17
- async createOrg(socket, data) {
17
+ async createOrg(socket, data, socketInfo) {
18
18
  const self = this;
19
19
  if(!data.data) return;
20
20
 
@@ -33,7 +33,7 @@ class CoCreateOrganization {
33
33
 
34
34
  const response = { ...data, document_id: orgId }
35
35
 
36
- self.wsManager.send(socket, 'createOrg', response );
36
+ self.wsManager.send(socket, 'createOrg', response, socketInfo);
37
37
  self.wsManager.broadcast(socket, data.namespace || data['organization_id'] , data.room, 'createDocument', response);
38
38
 
39
39
  // add new org to platformDB
@@ -49,7 +49,7 @@ class CoCreateOrganization {
49
49
  }
50
50
 
51
51
 
52
- async deleteOrg(socket, data) {
52
+ async deleteOrg(socket, data, socketInfo) {
53
53
  const self = this;
54
54
  if(!data.data) return;
55
55
  try{