Skip to content

Commit

Permalink
add memberships.get
Browse files Browse the repository at this point in the history
  • Loading branch information
chregu committed Oct 22, 2019
1 parent 5fda315 commit 93af307
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ rokka.memberships.list('myorg')
.catch(function(err) {});
```

#### rokka.memberships.get(organization, rokka) → Promise

Get info of a member in an organization.

```js
rokka.memberships.get('myorg',userId)
.then(function(result) {})
.catch(function(err) {});
```

---

<!-- End ../src/apis/memberships.js -->
Expand Down
20 changes: 20 additions & 0 deletions src/apis/memberships.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ export default state => {
return state.request('GET', path)
}

/**
* Get info of a member in an organization.
*
* ```js
* rokka.memberships.get('myorg',userId)
* .then(function(result) {})
* .catch(function(err) {});
* ```
*
* @authenticated
* @param {string} organization name
* @param {string} rokka userId
* @return {Promise}
*/
memberships.get = (organization, userId) => {
const path = `organizations/${organization}/memberships/${userId}`

return state.request('GET', path)
}

return {
memberships
}
Expand Down

0 comments on commit 93af307

Please sign in to comment.