diff options
Diffstat (limited to 'client/src/app/admin')
-rw-r--r-- | client/src/app/admin/friends/friend-list/friend-list.component.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/client/src/app/admin/friends/friend-list/friend-list.component.ts b/client/src/app/admin/friends/friend-list/friend-list.component.ts index 379d44c97..38d4799a6 100644 --- a/client/src/app/admin/friends/friend-list/friend-list.component.ts +++ b/client/src/app/admin/friends/friend-list/friend-list.component.ts | |||
@@ -15,11 +15,7 @@ export class FriendListComponent implements OnInit { | |||
15 | constructor(private friendService: FriendService) { } | 15 | constructor(private friendService: FriendService) { } |
16 | 16 | ||
17 | ngOnInit() { | 17 | ngOnInit() { |
18 | this.friendService.getFriends().subscribe( | 18 | this.getFriends(); |
19 | friends => this.friends = friends, | ||
20 | |||
21 | err => alert(err) | ||
22 | ); | ||
23 | } | 19 | } |
24 | 20 | ||
25 | quitFriends() { | 21 | quitFriends() { |
@@ -28,8 +24,17 @@ export class FriendListComponent implements OnInit { | |||
28 | this.friendService.quitFriends().subscribe( | 24 | this.friendService.quitFriends().subscribe( |
29 | status => { | 25 | status => { |
30 | alert('Quit friends!'); | 26 | alert('Quit friends!'); |
27 | this.getFriends(); | ||
31 | }, | 28 | }, |
32 | error => alert(error) | 29 | error => alert(error) |
33 | ); | 30 | ); |
34 | } | 31 | } |
32 | |||
33 | private getFriends() { | ||
34 | this.friendService.getFriends().subscribe( | ||
35 | friends => this.friends = friends, | ||
36 | |||
37 | err => alert(err) | ||
38 | ); | ||
39 | } | ||
35 | } | 40 | } |