@carbonorm/carbonreact 3.5.2 → 3.5.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbonorm/carbonreact",
3
3
  "license": "MIT",
4
- "version": "3.5.2",
4
+ "version": "3.5.4",
5
5
  "browser": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "main": "dist/index.cjs.js",
@@ -115,7 +115,7 @@ export function initiateWebsocket({
115
115
 
116
116
  const METHOD: string = parsedData?.REST?.METHOD;
117
117
 
118
- const REQUEST: { [key:string]: any } = parsedData?.REST?.REQUEST;
118
+ const REQUEST: { [key: string]: any } = parsedData?.REST?.REQUEST;
119
119
 
120
120
  const REQUEST_PRIMARY_KEY: {
121
121
  [key: string]: string
@@ -156,9 +156,9 @@ export function initiateWebsocket({
156
156
  // remove the table name from the column name
157
157
  const column = element.split('.')[1]
158
158
 
159
- console.log('column', column, REQUEST_PRIMARY_KEY[column], row[column])
159
+ console.log('column', column, REQUEST_PRIMARY_KEY[element], row[column])
160
160
 
161
- if (REQUEST_PRIMARY_KEY[column] !== row[column]) {
161
+ if (REQUEST_PRIMARY_KEY[element] !== row[column]) {
162
162
 
163
163
  return false
164
164
 
@@ -178,15 +178,17 @@ export function initiateWebsocket({
178
178
  }
179
179
 
180
180
  const updatedElements = elementsToUpdate.map((row: any) => {
181
+
181
182
  return {
182
183
  ...row,
183
184
  ...REQUEST
184
185
  }
185
- })
186
186
 
187
- console.log('updatedElements', updatedElements)
187
+ })
188
188
 
189
- WsLiveUpdates[TABLE_NAME_SHORT][METHOD]({}, updatedElements)
189
+ updatedElements.forEach((row: any) => {
190
+ WsLiveUpdates[TABLE_NAME_SHORT][METHOD]({}, row)
191
+ })
190
192
 
191
193
  }
192
194