diff --git a/src/prepareRequest.js b/src/prepareRequest.js index f3d8d99..c3f594a 100644 --- a/src/prepareRequest.js +++ b/src/prepareRequest.js @@ -43,6 +43,11 @@ function prepareRequest (data) { myInit = { method: 'GET'} break + case 'getActiveProfile': + url = `${url}/getActiveProfile` + myInit = { method: 'GET'} + break + default: break } diff --git a/src/restclient.js b/src/restclient.js index 7363bb2..48e2401 100644 --- a/src/restclient.js +++ b/src/restclient.js @@ -164,6 +164,24 @@ class GlpiRestClient { } }) } + + getActiveProfile () { + return new Promise((resolve, reject) => { + try { + const data = { + function: 'getActiveProfile' + } + this._makeRequest( prepareRequest(data), 'getActiveProfile', (promise) => { + promise.then(response => { + resolve ( response ) + }) + }) + } + catch (err) { + reject(err) + } + }) + } } export default GlpiRestClient