import { Injectable, inject } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { API_URL } from '../../core/tokens/api-url.token'; import { Review } from '../../core/models/review.model'; @Injectable({ providedIn: 'root' }) export class ReviewService { private http = inject(HttpClient); private apiUrl = inject(API_URL); private readonly endpoint = '/admin/AdminReviews'; getAll(): Observable { return this.http.get(`${this.apiUrl}${this.endpoint}`); } approve(id: string): Observable { return this.http.post(`${this.apiUrl}${this.endpoint}/${id}/approve`, {}); } delete(id: string): Observable { return this.http.delete(`${this.apiUrl}${this.endpoint}/${id}`); } }