Created
May 21, 2019 18:53
-
-
Save arturovt/4c5cddb5742a5ebe5ab705e89b9df3ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Injectable({ providedIn: 'root' }) | |
| export class UserService { | |
| constructor(private http: HttpClient, private store: Store) {} | |
| public getUser() { | |
| const { id } = this.store.selectSnapshot<UserStateModel>(UserState); | |
| return this.http.get(`${environment.apiUrl}/users/${id}`); | |
| } | |
| public getLoginHistory() { | |
| const { id } = this.store.selectSnapshot<UserStateModel>(UserState); | |
| return this.http.get(`${environment.apiUrl}/users/login-history/${id}`); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment