Skip to content

Commit 3b4c4f7

Browse files
committed
enable updating admin away mode and reassignment settings
1 parent 25f02cd commit 3b4c4f7

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ client.admins.me(callback);
413413
client.admins.find('123456789', callback);
414414
```
415415

416+
```
417+
// Update admin away mode and reassign settings
418+
client.admins.away('123456789', {'away_mode_enabled': true, 'away_mode_reassign': false}, callback);
419+
```
420+
416421
## Tags
417422

418423
```node

lib/admin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ export default class Admin {
1111
me(f) {
1212
return this.client.get('/me', {}, f);
1313
}
14+
away(id, params, f) {
15+
return this.client.put(`/admins/${id}/away`, params, f);
16+
}
1417
}

test/admin.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ describe('admins', () => {
2727
done();
2828
});
2929
});
30+
it('should update admin away mode and reassign settings', done => {
31+
nock('https://api.intercom.io').put('/admins/baz/away', { away_mode_enabled: true, away_mode_reassign: false }).reply(200, {});
32+
const client = new Client('foo', 'bar').usePromises();
33+
client.admins.away('baz', { away_mode_enabled: true, away_mode_reassign: false }).then(r => {
34+
assert.equal(200, r.statusCode);
35+
done();
36+
});
37+
});
3038
});

0 commit comments

Comments
 (0)