Skip to content

Commit

Permalink
feat(GlpiRestClient): get active profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianfranco97 authored and Hector Rondon committed Jan 17, 2018
1 parent 9dd5891 commit 9a48a7e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/prepareRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ function prepareRequest (data) {
myInit = { method: 'GET'}
break

case 'getActiveProfile':
url = `${url}/getActiveProfile`
myInit = { method: 'GET'}
break

default:
break
}
Expand Down
18 changes: 18 additions & 0 deletions src/restclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9a48a7e

Please sign in to comment.