oneentry 1.0.82 → 1.0.83
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.
|
@@ -10,6 +10,7 @@ export default abstract class SyncModules {
|
|
|
10
10
|
protected _normalizeData(data: any, langCode?: string): any;
|
|
11
11
|
protected _normalizePostBody(body: any, langCode?: string): any;
|
|
12
12
|
protected _clearArray(data: Record<string, any>): any;
|
|
13
|
+
protected _normalizeAttr(data: any): any;
|
|
13
14
|
protected _dataPostProcess(data: any, langCode?: string): any;
|
|
14
15
|
setAccessToken(accessToken: string): this;
|
|
15
16
|
setRefreshToken(refreshToken: string): this;
|
package/dist/base/syncModules.js
CHANGED
|
@@ -19,7 +19,7 @@ class SyncModules {
|
|
|
19
19
|
}
|
|
20
20
|
_normalizeData(data, langCode = this.state.lang) {
|
|
21
21
|
if (Array.isArray(data)) {
|
|
22
|
-
return data.map(item => this._normalizeData(item, langCode));
|
|
22
|
+
return this._normalizeAttr(data.map(item => this._normalizeData(item, langCode)));
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
const normalizeData = {};
|
|
@@ -34,7 +34,7 @@ class SyncModules {
|
|
|
34
34
|
normalizeData[key] = this._normalizeData(data[key], langCode);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
return normalizeData;
|
|
37
|
+
return this._normalizeAttr(normalizeData);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
_normalizePostBody(body, langCode = this.state.lang) {
|
|
@@ -63,6 +63,16 @@ class SyncModules {
|
|
|
63
63
|
return dataWithoutArray;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
_normalizeAttr(data) {
|
|
67
|
+
if ('attributeValues' in data) {
|
|
68
|
+
for (let attr in data.attributeValues) {
|
|
69
|
+
if (data.attributeValues[attr].type === 'integer' || data.attributeValues[attr].type === 'float') {
|
|
70
|
+
data.attributeValues[attr].value = Number(data.attributeValues[attr].value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
66
76
|
_dataPostProcess(data, langCode = this.state.lang) {
|
|
67
77
|
const normalize = this._normalizeData(data, langCode);
|
|
68
78
|
const result = this._clearArray(normalize);
|