import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { environment } from '../../../environment'; import { AuthService } from '../auth/auth.service'; @Injectable({ providedIn: 'root', }) export class FriendsService { private apiURL = environment.apiURL; constructor(private http: HttpClient, private authService: AuthService) {} getFriend() { return this.http.get(`${this.apiURL}/friends`); } getFriendById(id: string) { return this.http.get(`${this.apiURL}/user/${id}`); } addFriend(user_id: string) { return this.http.post(`${this.apiURL}/friend/add`, { friend_user_id: user_id }); } acceptFriendById(id: string) { return this.http.patch(`${this.apiURL}/friend/${id}/accept`, []); } denyFriendById(id: string) { return this.http.delete(`${this.apiURL}/friend/${id}/deny`); } deleteFriend(id: string) { return this.http.delete(`${this.apiURL}/friend/${id}/delete`); } }