@cocreate/unique 1.14.1 → 1.14.2
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 +8 -0
- package/package.json +1 -1
- package/src/client.js +1 -1
- package/src/server.js +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.14.2](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.14.1...v1.14.2) (2023-09-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* renamed filter to $filter ([5db5a1f](https://github.com/CoCreate-app/CoCreate-unique/commit/5db5a1f4795aa37574e69e3b5c4fa10b5b72895a))
|
|
7
|
+
* socket referenced in the data object. data.socket ([da15823](https://github.com/CoCreate-app/CoCreate-unique/commit/da15823e0b781c921bad72363f3f4edeb8e85a09))
|
|
8
|
+
|
|
1
9
|
## [1.14.1](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.14.0...v1.14.1) (2023-08-21)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
package/src/client.js
CHANGED
package/src/server.js
CHANGED
|
@@ -10,8 +10,7 @@ class CoCreateUnique {
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
if (this.wsManager) {
|
|
13
|
-
this.wsManager.on('isUnique',
|
|
14
|
-
(socket, data) => this.isUnique(socket, data));
|
|
13
|
+
this.wsManager.on('isUnique', (data) => this.isUnique(data));
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -24,7 +23,7 @@ class CoCreateUnique {
|
|
|
24
23
|
*
|
|
25
24
|
* @return { Promise } - resolves with the response from the server or rejects with an error if there was a
|
|
26
25
|
*/
|
|
27
|
-
async isUnique(
|
|
26
|
+
async isUnique(data) {
|
|
28
27
|
const self = this
|
|
29
28
|
try {
|
|
30
29
|
data.method = 'read.object'
|
|
@@ -38,7 +37,7 @@ class CoCreateUnique {
|
|
|
38
37
|
if (data.object.length) {
|
|
39
38
|
response.unique = false;
|
|
40
39
|
}
|
|
41
|
-
return self.wsManager.send(
|
|
40
|
+
return self.wsManager.send(response);
|
|
42
41
|
})
|
|
43
42
|
} catch (error) {
|
|
44
43
|
console.log(error);
|