Skip to content

Commit 44726ac

Browse files
Merge pull request #231 from terminusdb/add_get_org
Add get org
2 parents 4339f58 + c6a802b commit 44726ac

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/api/accesscontrol.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ add extra headers to your request
104104
| customHeaders | <code>object</code> |
105105

106106

107+
## getOrganization
108+
##### accessControl.getOrganization(organization) ⇒ <code>object</code>
109+
-- TerminusDB API ---
110+
Get an organization from the TerminusDB API.
111+
112+
**Returns**: <code>object</code> - - organization
113+
114+
| Param | Type | Description |
115+
| --- | --- | --- |
116+
| organization | <code>string</code> | The organization |
117+
118+
107119
## getAllOrganizations
108120
##### accessControl.getAllOrganizations() ⇒ <code>Promise</code>
109121
-- TerminusDB API ---

lib/accessControl.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ AccessControl.prototype.customHeaders = function (customHeaders) {
160160
else return this._customHeaders;
161161
};
162162

163+
/**
164+
* -- TerminusDB API ---
165+
* Get an organization from the TerminusDB API.
166+
* @param {string} organization - The organization
167+
* @return {object} - organization
168+
*/
169+
AccessControl.prototype.getOrganization = function (org) {
170+
return this.dispatch(`${this.baseURL}/organizations/${org}`, CONST.GET);
171+
};
172+
163173
/**
164174
* -- TerminusDB API ---
165175
* This end point works in basic authentication, admin user

0 commit comments

Comments
 (0)