Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit 64538db

Browse files
committed
feat: add support for getting single worker
1 parent 7cdc7f1 commit 64538db

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/onfleet.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ class Onfleet {
6969
});
7070
}
7171

72+
/**
73+
* Gets a single worker details.
74+
*
75+
* http://docs.onfleet.com/v2.0/docs/workers#get-single-worker
76+
*
77+
* @param {string} id
78+
*/
79+
getWorker(id) {
80+
return this.get('/workers/' + id).then(response => JSON.parse(response));
81+
}
82+
7283
/**
7384
* Gets a list of all drivers along with their current `onDuty` status, last reported
7485
* `location`, assigned `tasks` list and the ID of their `activeTask`, if there is one.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onfleet",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Node client for Onfleet",
55
"main": "lib/onfleet.js",
66
"scripts": {

0 commit comments

Comments
 (0)