24 lines
659 B
TypeScript
24 lines
659 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { EntryRating } from '../../shared/models/entry-rating.model';
|
|
import { environment } from '../../../environments/environment.prod';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class EntryRatingsService {
|
|
private backend_apiUrl = environment.API_URL;
|
|
private apiAction = 'entry-ratings';
|
|
|
|
constructor(private http: HttpClient) {}
|
|
|
|
updateEntryRatings(entryRatings: EntryRating) {
|
|
return this.http.put<EntryRating>(
|
|
`${this.backend_apiUrl}/${this.apiAction}/${entryRatings.id}`,
|
|
{
|
|
entryR: entryRatings,
|
|
}
|
|
);
|
|
}
|
|
}
|