@cocreate/unique 1.4.6 → 1.5.0
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 +7 -0
- package/package.json +1 -1
- package/src/client.js +0 -2
- package/src/server.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.5.0](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.4.6...v1.5.0) (2022-09-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* config is accessible from socket.config ([e473477](https://github.com/CoCreate-app/CoCreate-unique/commit/e4734771a22ad502bf2c3c0e09dfd39bf4544d1b))
|
|
7
|
+
|
|
1
8
|
## [1.4.6](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.4.5...v1.4.6) (2022-09-01)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -50,8 +50,6 @@ const CoCreateUnique = {
|
|
|
50
50
|
input.addEventListener('input', function(e) {
|
|
51
51
|
let request_data = {};
|
|
52
52
|
let value = input.getValue();
|
|
53
|
-
request_data['organization_id'] = window.config.organization_id;
|
|
54
|
-
request_data['apiKey'] = window.config.apiKey;
|
|
55
53
|
request_data['collection'] = input.getAttribute('collection');
|
|
56
54
|
request_data['name'] = input.getAttribute('name');
|
|
57
55
|
request_data['value'] = value || e.target.value;
|
package/src/server.js
CHANGED
|
@@ -8,12 +8,12 @@ class CoCreateUnique {
|
|
|
8
8
|
init() {
|
|
9
9
|
if (this.wsManager) {
|
|
10
10
|
this.wsManager.on('checkUnique',
|
|
11
|
-
(socket, data
|
|
11
|
+
(socket, data) => this.checkUnique(socket, data));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
async checkUnique(socket, req_data
|
|
16
|
+
async checkUnique(socket, req_data) {
|
|
17
17
|
const self = this
|
|
18
18
|
const db = this.dbClient.db(req_data['organization_id']);
|
|
19
19
|
const collection = db.collection(req_data["collection"]);
|
|
@@ -32,7 +32,7 @@ class CoCreateUnique {
|
|
|
32
32
|
if (result.length) {
|
|
33
33
|
response.unique = false;
|
|
34
34
|
}
|
|
35
|
-
self.wsManager.send(socket, 'checkedUnique', response
|
|
35
|
+
self.wsManager.send(socket, 'checkedUnique', response);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
} catch (error) {
|