Skip to content

Commit 847b814

Browse files
authored
Merge branch 'master' into setup-semantic-release
2 parents 2211d6e + 05155e9 commit 847b814

File tree

3 files changed

+5328
-4
lines changed

3 files changed

+5328
-4
lines changed

example/example.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ const usabilla = new Usabilla(args[0], args[1]);
1010
// Get all buttons for this account.
1111
usabilla.websites.buttons.get().then((buttons) => {
1212

13+
const button = buttons[1];
14+
15+
if (!button) {
16+
return;
17+
}
18+
1319
// Use the button id to get feedback for this button id.
1420
let buttonFeedbackQuery = {
15-
id: buttons[0].id,
21+
id: button.id,
1622
params: {
1723
limit: 10
1824
}
@@ -30,9 +36,15 @@ usabilla.websites.buttons.get().then((buttons) => {
3036
// Get all campaigns for this account.
3137
usabilla.websites.campaigns.get().then((campaigns) => {
3238

39+
const campaign = campaigns[0];
40+
41+
if (!campaign) {
42+
return;
43+
}
44+
3345
// Get the results for a campaign with id.
3446
let campaignQuery = {
35-
id: campaigns[0].id
47+
id: campaign.id
3648
};
3749

3850
// Get the responses of the first campaign
@@ -86,9 +98,15 @@ usabilla.email.widgets.get().then((emailWidgets) => {
8698
// Get all apps forms for this account.
8799
usabilla.apps.forms.get().then((appsForms) => {
88100

101+
const appsForm = appsForms[1];
102+
103+
if (!appsForm) {
104+
return;
105+
}
106+
89107
// Get the feedback for a apps form with id.
90108
let appsQuery = {
91-
id: appsForms[1].id
109+
id: appsForm.id
92110
};
93111

94112
// Get the feedback of the second app form

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const browserify = require('browserify');
44
const babelify = require('babelify');
55

66
const paths = {
7-
src: './src',
7+
src: './src/**/*.js',
88
dist: './dist',
99
entry: './src/index.js',
1010
filename: 'index.js',

0 commit comments

Comments
 (0)