Skip to content

Commit

Permalink
Api added to get a single update of a company
Browse files Browse the repository at this point in the history
  • Loading branch information
mystery-man committed Feb 23, 2016
1 parent 248c1cf commit 81c4786
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/services/companies.js
Expand Up @@ -52,6 +52,14 @@
this.createCall('GET', 'companies', {"is-company-admin": true}, cb)(this.config);
};

this.getUpdate = function (id, updateId, options, cb) {
if (_.isFunction(options)) {
cb = options;
options = {};
}
this.createCall('GET', 'companies/' + id + '/updates/key=' + updateId, options, cb)(this.config);
};

this.updates = function (id, options, cb) {
if (_.isFunction(options)) {
cb = options;
Expand Down
9 changes: 9 additions & 0 deletions specs/services/companies_spec.js
Expand Up @@ -96,6 +96,15 @@ describe('API: Companies Test Suite', function() {
done();
});
});

it('should get recent company updates by company id', function (done) {
linkedin.companies.getUpdate(1337, 'UPDATE-c1337-998877665544332211', function (err, updates) {
expect(err).toBe(null);
expect(updates).not.toBe(null);
expect(typeof updates).toBe('object');
done();
});
});

it('should should share a company update by company id', function (done) {
linkedin.companies.share(2414183, {
Expand Down

0 comments on commit 81c4786

Please sign in to comment.