Skip to content

Commit

Permalink
feat(GlpiRestClient): get active entities
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 a33984f commit a35dc15
Show file tree
Hide file tree
Showing 2 changed files with 24 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 @@ -57,6 +57,11 @@ function prepareRequest (data) {
url = `${url}/getMyEntities`
myInit = { method: 'GET'}
break

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

default:
break
Expand Down
19 changes: 19 additions & 0 deletions src/restclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,25 @@ class GlpiRestClient {
}
})
}

getActiveEntities () {
return new Promise((resolve, reject) => {
try {
const data = {
function: 'getActiveEntities'
}
this._makeRequest( prepareRequest(data), 'getActiveEntities', (promise) => {
promise.then(response => {
resolve ( response )
})
})
}
catch (err) {
reject(err)
}
})
}

}

export default GlpiRestClient

0 comments on commit a35dc15

Please sign in to comment.