Skip to content

Commit eaeee32

Browse files
authored
fix(docs): fix fetch users example on README (#7)
1 parent 23e7821 commit eaeee32

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Heimdall
22

3-
## Instalation
3+
## Installation
44

55
npm install @indec/heimdall
66

@@ -15,7 +15,7 @@ AUTH_CLIENT_SECRET=<your app secret>
1515
GRANT_TYPE=client_credentials
1616
```
1717

18-
## Example
18+
## Examples
1919

2020
### Login on client side
2121

@@ -24,7 +24,7 @@ import {LoginService} from '@indec/heimdall/client';
2424

2525
// ENDPOINT constant is your heimdall server. i.e: http://localhost:5000
2626
const loginService = new LoginService(ENDPOINT);
27-
const token = await loginService.login(username, password)
27+
const token = await loginService.login(username, password);
2828
```
2929

3030
### Clean user session
@@ -41,9 +41,11 @@ List your app's users on server side:
4141

4242
```js
4343
const {UserService} = require('@indec/heimdall').services;
44-
UserService.fetchAll.then(
45-
users => console.log(users)
46-
).catch(
47-
err => console.error(err)
48-
)
44+
45+
try {
46+
const users = await UserService.fetchAll();
47+
console.log(users);
48+
} catch (err) {
49+
console.error(err);
50+
}
4951
```

0 commit comments

Comments
 (0)