diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-12 18:22:58 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-12 18:22:58 +0200 |
commit | e2f555cab7563cd74fa790cea5fc65f2e31b0dc0 (patch) | |
tree | 73b68f28c3d8b4521612e5c6de120d2d2614dd70 /client/src/app/admin/menu-admin.component.ts | |
parent | c323efb9cdc6a605242d112ac0c9db9f67eabaad (diff) | |
download | PeerTube-e2f555cab7563cd74fa790cea5fc65f2e31b0dc0.tar.gz PeerTube-e2f555cab7563cd74fa790cea5fc65f2e31b0dc0.tar.zst PeerTube-e2f555cab7563cd74fa790cea5fc65f2e31b0dc0.zip |
Client: add friends page
Diffstat (limited to 'client/src/app/admin/menu-admin.component.ts')
-rw-r--r-- | client/src/app/admin/menu-admin.component.ts | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/client/src/app/admin/menu-admin.component.ts b/client/src/app/admin/menu-admin.component.ts index eb27c1e58..b23f7409e 100644 --- a/client/src/app/admin/menu-admin.component.ts +++ b/client/src/app/admin/menu-admin.component.ts | |||
@@ -1,42 +1,15 @@ | |||
1 | import { Component, Output, EventEmitter } from '@angular/core'; | 1 | import { Component, Output, EventEmitter } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | 2 | import { ROUTER_DIRECTIVES } from '@angular/router'; |
3 | 3 | ||
4 | import { FriendService } from './friends'; | ||
5 | |||
6 | @Component({ | 4 | @Component({ |
7 | selector: 'my-menu-admin', | 5 | selector: 'my-menu-admin', |
8 | template: require('./menu-admin.component.html'), | 6 | template: require('./menu-admin.component.html'), |
9 | directives: [ ROUTER_DIRECTIVES ], | 7 | directives: [ ROUTER_DIRECTIVES ] |
10 | providers: [ FriendService ] | ||
11 | }) | 8 | }) |
12 | export class MenuAdminComponent { | 9 | export class MenuAdminComponent { |
13 | @Output() quittedAdmin = new EventEmitter<boolean>(); | 10 | @Output() quittedAdmin = new EventEmitter<boolean>(); |
14 | 11 | ||
15 | constructor(private friendService: FriendService) {} | ||
16 | |||
17 | makeFriends() { | ||
18 | this.friendService.makeFriends().subscribe( | ||
19 | status => { | ||
20 | if (status === 409) { | ||
21 | alert('Already made friends!'); | ||
22 | } else { | ||
23 | alert('Made friends!'); | ||
24 | } | ||
25 | }, | ||
26 | error => alert(error) | ||
27 | ); | ||
28 | } | ||
29 | |||
30 | quitAdmin() { | 12 | quitAdmin() { |
31 | this.quittedAdmin.emit(true); | 13 | this.quittedAdmin.emit(true); |
32 | } | 14 | } |
33 | |||
34 | quitFriends() { | ||
35 | this.friendService.quitFriends().subscribe( | ||
36 | status => { | ||
37 | alert('Quit friends!'); | ||
38 | }, | ||
39 | error => alert(error) | ||
40 | ); | ||
41 | } | ||
42 | } | 15 | } |