Add rating to chapter page & volume (if one chapter)

This commit is contained in:
Amelia 2025-04-26 09:40:56 +02:00
parent e96cb0fde9
commit 8ccc2b5801
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
18 changed files with 226 additions and 47 deletions

View file

@ -4,6 +4,7 @@ import { HttpClient } from "@angular/common/http";
import {Chapter} from "../_models/chapter";
import {TextResonse} from "../_types/text-response";
import {UserReview} from "../_single-module/review-card/user-review";
import {Rating} from "../_models/rating";
@Injectable({
providedIn: 'root'
@ -35,11 +36,19 @@ export class ChapterService {
}
updateChapterReview(seriesId: number, chapterId: number, body: string, rating: number) {
return this.httpClient.post<UserReview>(this.baseUrl + 'review/chapter/'+chapterId, {seriesId, body});
return this.httpClient.post<UserReview>(this.baseUrl + 'review/chapter/'+chapterId, {seriesId, rating, body});
}
deleteChapterReview(chapterId: number) {
return this.httpClient.delete(this.baseUrl + 'review/chapter/'+chapterId);
}
overallRating(chapterId: number) {
return this.httpClient.get<Rating>(this.baseUrl + 'rating/overall?chapterId='+chapterId);
}
updateRating(chapterId: number, rating: number) {
return this.httpClient.post(this.baseUrl + 'chapter/update-rating', {chapterId, rating});
}
}