@journeyapps-solutions/cc-util-sync-collective 0.0.7 → 0.0.10

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/lib/index.js CHANGED
@@ -63,7 +63,7 @@ class SyncCollective {
63
63
  *
64
64
  * let _object = webhook.object;
65
65
  * let _operation = webhook.operation;
66
- * let _sync_tables = DB.sync_table.where("table_name = ?", _object.type).first();
66
+ * let _sync_tables = DB.sync_table.where("table_name = ?", _object.type.name).first();
67
67
  * let _endpoint = sync_table.endpoint();
68
68
  *
69
69
  * SyncCollective.syncToSlave({
@@ -12,7 +12,7 @@ class SyncUtilMaster extends SyncUtil {
12
12
  * @return String of the table name on the endpoint
13
13
  */
14
14
  buildTableName(object, collective) {
15
- return object.type.toString().replace(collective + '_', '');
15
+ return object.type.name.toString().replace(collective + '_', '');
16
16
  }
17
17
 
18
18
  };
@@ -11,7 +11,7 @@ class SyncUtilSlave extends SyncUtil {
11
11
  * @return String of the table name on the broker
12
12
  */
13
13
  buildTableName(object, collective) {
14
- return `${collective}_${object.type}`;
14
+ return `${collective}_${object.type.name}`;
15
15
  }
16
16
 
17
17
  };
package/lib/sync-util.js CHANGED
@@ -26,6 +26,7 @@ class SyncUtil {
26
26
  buildJsonBody(object, collective) {
27
27
  this.mapChoiceObjects(object);
28
28
  this.removePhotosAttachments(object);
29
+
29
30
  let _tableName = this.buildTableName(object, collective);
30
31
  let new_object = {};
31
32
  new_object[_tableName] = object;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@journeyapps-solutions/cc-util-sync-collective",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "description": "Sync Data between projects. Either Directly, or via Slave & Master Configuration",
5
5
  "main": "./index.js",
6
6
  "scripts": {