You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Considering your code with promises in README.md, I wonder if you understand how we use them?
You take the path to the pyramid of doom.
This is the correct way to use promises :
const client = new GlpiRestClient(config.apirest);
client.initSessionByCredentials(config.user.name, config.user.password, config.appToken)
.then((res) => {
// Do your stuff here
return client.getActiveProfile();
})
.then((res) => {
// Do your stuff here
return client.killSession();
})
.catch((err) => {
console.log(err);
});
hth
The text was updated successfully, but these errors were encountered:
Considering your code with promises in README.md, I wonder if you understand how we use them?
You take the path to the pyramid of doom.
This is the correct way to use promises :
hth
The text was updated successfully, but these errors were encountered: