@maxzima/wa-communicator 1.0.12 → 1.0.13
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.
|
@@ -135,16 +135,12 @@ export class Communicator {
|
|
|
135
135
|
registration(data) {
|
|
136
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
137
|
const headers = this.getHeaders(data.accessToken);
|
|
138
|
-
const body = JSON.stringify({
|
|
139
|
-
name: data.name,
|
|
140
|
-
country_code: data.countryCode,
|
|
141
|
-
source: {
|
|
138
|
+
const body = JSON.stringify(Object.assign(Object.assign({ name: data.name }, (data.countryCode && { country_code: data.countryCode })), { source: {
|
|
142
139
|
hash: data.hash,
|
|
143
140
|
device_type: data.deviceType,
|
|
144
141
|
ga_id: data.gaId,
|
|
145
142
|
origin: data.origin,
|
|
146
|
-
}
|
|
147
|
-
});
|
|
143
|
+
} }));
|
|
148
144
|
return yield this.send({
|
|
149
145
|
method: 'POST',
|
|
150
146
|
url: `${this.props.clientFAPIBaseUrl}${"clients/registration"}`,
|
package/package.json
CHANGED
|
@@ -128,7 +128,7 @@ export class Communicator {
|
|
|
128
128
|
const headers = this.getHeaders(data.accessToken);
|
|
129
129
|
const body = JSON.stringify({
|
|
130
130
|
name: data.name,
|
|
131
|
-
country_code: data.countryCode,
|
|
131
|
+
...(data.countryCode && { country_code: data.countryCode }),
|
|
132
132
|
source: {
|
|
133
133
|
hash: data.hash,
|
|
134
134
|
device_type: data.deviceType,
|