Skip to content

Commit

Permalink
Merge pull request #61 from mystery-man/master
Browse files Browse the repository at this point in the history
Api added to get a single update of a company
  • Loading branch information
ArkeologeN committed Feb 24, 2016
2 parents 248c1cf + 59c7448 commit ca2ea29
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -167,6 +167,14 @@ linkedin.companies.multiple('162479,universal-name=linkedin', function(err, comp
linkedin.companies.asAdmin(function(err, companies) {
// Here you go
});

linkedin.companies.updates('162479', function(err, company) {
// Gets all the updates(Posts) along with their details of a company
});

linkedin.companies.getUpdate('162479','UPDATE-c1337-998877665544332211',function(err, companies) {
// Gets the detail of a single update(Post) of a company
});
```
## Profile
Expand Down
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 ca2ea29

Please sign in to comment.