|
|
@ -1,10 +1,10 @@
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { FriendsService } from '../../services/friends/friends.service';
|
|
|
|
import { FriendsService } from '../../services/friends/friends.service';
|
|
|
|
import { NgFor, NgIf } from '@angular/common';
|
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-friend-page',
|
|
|
|
selector: 'app-friend-page',
|
|
|
|
imports: [NgFor, NgIf],
|
|
|
|
imports: [CommonModule],
|
|
|
|
templateUrl: './friend-page.component.html',
|
|
|
|
templateUrl: './friend-page.component.html',
|
|
|
|
styleUrls: ['./friend-page.component.css']
|
|
|
|
styleUrls: ['./friend-page.component.css']
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -12,6 +12,7 @@ export class FriendPageComponent implements OnInit {
|
|
|
|
protected listFriend: {username: string, status: string, friend_user_id: string}[] = [];
|
|
|
|
protected listFriend: {username: string, status: string, friend_user_id: string}[] = [];
|
|
|
|
userId: string = "";
|
|
|
|
userId: string = "";
|
|
|
|
status: string = "";
|
|
|
|
status: string = "";
|
|
|
|
|
|
|
|
isFriendModalOpen: boolean = false;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private friendService: FriendsService) {
|
|
|
|
constructor(private friendService: FriendsService) {
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -43,4 +44,11 @@ export class FriendPageComponent implements OnInit {
|
|
|
|
this.friendService.acceptOrDenyFriendById(friend_user_id,choice).subscribe()
|
|
|
|
this.friendService.acceptOrDenyFriendById(friend_user_id,choice).subscribe()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openFriendModal() {
|
|
|
|
|
|
|
|
this.isFriendModalOpen = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
closeFriendModal() {
|
|
|
|
|
|
|
|
this.isFriendModalOpen = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|