@cocreate/crud-client
Advanced tools
Comparing version 1.33.12 to 1.33.13
{ | ||
"name": "@cocreate/crud-client", | ||
"version": "1.33.12", | ||
"version": "1.33.13", | ||
"description": "An useful CRUD api operate Create, read, update, delete with built in database. Can be used as a firebase alternative. Easily configured using HTML5 attributes and/or JavaScript API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -131,3 +131,6 @@ /******************************************************************************** | ||
sync: async function (data) { | ||
if (indexeddb && data.uid && data.status && data.status == 'received') { | ||
if (indexeddb && data.uid && data.status && data.status == 'received' && !data.synced) { | ||
if (data.host && data.host.startsWith('dev.') || data.host.startsWith('test.')) | ||
data.database = data.organization_id | ||
if (data.method.endsWith('.read')) { | ||
@@ -203,2 +206,3 @@ if (this.socket.has(data.socketId)) { | ||
} else if (this.socket.clientId != data.clientId || data.updateDB) { | ||
data.synced = true | ||
// TODO: if database was updated due to host and environment handling | ||
@@ -208,7 +212,10 @@ if (data.updateDB) | ||
// TODO: returned from server socket.send authorize | ||
// TODO: returned from server socket.send authorize perhaps requires a flag so that it can be removed after autorization.. | ||
if (data.$filter && data.$filter.query && data.$filter.query._id && data.$filter.query._id.$eq === '$user_id') | ||
data.$filter.query._id.$eq = this.socket.user_id | ||
this.socket.sendLocalMessage(data); | ||
indexeddb.send({ ...data }) | ||
} | ||
@@ -215,0 +222,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200063
537