Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
test fix erxes/erxes#1539
Browse files Browse the repository at this point in the history
  • Loading branch information
batamar committed Dec 29, 2019
1 parent b722654 commit 19c3b73
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/data/dataSources/engages.ts
@@ -1,4 +1,5 @@
import { HTTPCache, RESTDataSource } from 'apollo-datasource-rest';
import { debugBase } from '../../debuggers';
import { getEnv } from '../utils';

export default class EngagesAPI extends RESTDataSource {
Expand Down Expand Up @@ -48,10 +49,22 @@ export default class EngagesAPI extends RESTDataSource {
}

public async engagesStats(engageMessageId) {
return this.get(`/deliveryReports/statsList/${engageMessageId}`);
try {
const response = await this.get(`/deliveryReports/statsList/${engageMessageId}`);
return response;
} catch (e) {
debugBase(e.message);
return {};
}
}

public engagesLogs(engageMessageId) {
return this.get(`/deliveryReports/logs/${engageMessageId}`);
public async engagesLogs(engageMessageId) {
try {
const response = await this.get(`/deliveryReports/logs/${engageMessageId}`);
return response;
} catch (e) {
debugBase(e.message);
return [];
}
}
}

0 comments on commit 19c3b73

Please sign in to comment.