@cocreate/file-server 1.17.0 → 1.17.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.17.1](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.17.0...v1.17.1) (2024-11-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * handing condition if organization id not found ([d0a956d](https://github.com/CoCreate-app/CoCreate-file-server/commit/d0a956d2e1f88c5c836a346972dff72fc28f2b97))
7
+
1
8
  # [1.17.0](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.16.11...v1.17.0) (2024-09-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file-server",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "A simple file-server component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "file-server",
package/src/index.js CHANGED
@@ -42,12 +42,13 @@ class CoCreateFileSystem {
42
42
  }
43
43
  }
44
44
 
45
+ let organization_id
45
46
  if (!organization || organization.error) {
46
47
  let hostNotFound = await getDefaultFile('/hostNotFound.html')
47
48
  return sendResponse(hostNotFound.object[0].src, 404, { 'Content-Type': 'text/html' })
48
49
  }
49
50
 
50
- const organization_id = organization._id
51
+ organization_id = organization._id
51
52
  data.organization_id = organization_id
52
53
 
53
54
  res.setHeader('organization', organization_id)
@@ -176,11 +177,12 @@ class CoCreateFileSystem {
176
177
  src = JSON.stringify(src);
177
178
  }
178
179
 
179
- crud.wsManager.emit("setBandwidth", {
180
- type: 'out',
181
- data: src,
182
- organization_id
183
- });
180
+ if (organization_id)
181
+ crud.wsManager.emit("setBandwidth", {
182
+ type: 'out',
183
+ data: src,
184
+ organization_id
185
+ });
184
186
  res.writeHead(statusCode, headers);
185
187
  return res.end(src);
186
188
  } catch (error) {