attlaz-client 1.10.5 → 1.10.7
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.
|
@@ -76,7 +76,7 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
76
76
|
}
|
|
77
77
|
async save(subscriberChannel) {
|
|
78
78
|
try {
|
|
79
|
-
const url = '/channels
|
|
79
|
+
const url = '/channels/';
|
|
80
80
|
const result = await this.requestObject(url, subscriberChannel, Channel.parse, 'POST');
|
|
81
81
|
const updatedChannel = result.getData();
|
|
82
82
|
if (updatedChannel === null) {
|
package/dist/Service/Endpoint.js
CHANGED
|
@@ -80,7 +80,7 @@ export class Endpoint {
|
|
|
80
80
|
/**
|
|
81
81
|
* Parse data
|
|
82
82
|
*/
|
|
83
|
-
if (
|
|
83
|
+
if (requestResponse === null || requestResponse === undefined) {
|
|
84
84
|
throw new Error('Unable to parse collection: response is empty');
|
|
85
85
|
}
|
|
86
86
|
if (!requestResponse.hasOwnProperty('data') || requestResponse.data === undefined) {
|
|
@@ -103,8 +103,8 @@ export class Endpoint {
|
|
|
103
103
|
* Parse errors
|
|
104
104
|
*/
|
|
105
105
|
// TODO: temporary check until we know the API is fully upgraded
|
|
106
|
-
if (
|
|
107
|
-
throw new Error('Unable to parse object');
|
|
106
|
+
if (requestResponse === null || requestResponse === undefined) {
|
|
107
|
+
throw new Error('Unable to parse object: response is empty');
|
|
108
108
|
}
|
|
109
109
|
if ((requestResponse.hasOwnProperty('data') && !requestResponse.hasOwnProperty('id')) && requestResponse.data !== undefined) {
|
|
110
110
|
console.error('Response for object "' + action + '" seem to still use old "data" property', { requestResponse });
|